Integer is the data type we learned first from childhood. In the following write a Java program that does all of the fol
Posted: Mon Jul 11, 2022 9:55 am
question part (d) asks you to compute until the k-th number with f(k) > n, the number you read in at part (a), NOT the n-th Fibonacci number which can be very big and overflow for int data type. For example, if n = 4319, the number of rows (with 8 in a row) should be less than 10 rows. (e) (6%) Test your program with three numbers 4319, 2022, and a third number of your choice of 5 digits long.
Integer is the data type we learned first from childhood. In the following write a Java program that does all of the following (not programs). Do not use String or methods of String. Do not use array. Do not use special logic to handle ten's digits, hundred's digit etc. Write a Java program that (a) (3%) Reads an integer n of at least 3 digits from the keyboard. (check for that) (b) (2%) Computes and displays the sum of digits (c) (5%) Computes and displays the reverse of this integer and also the triple of the reversed integer (for example, 1234 reversed is 4321, and tripled reverse is 12963) (d) (6%) Computes and displays Fibonacci numbers f(k) 8 in a row until f(k) >n (f(k-1) <= n, but f(k) > n, with f(1) = f(2)= 1 (then f(3) = 2, f(4) = 3 etc.) Note. For Fibonacci numbers, the