To change a paragraph from Outline Level 1 to Outline Level 2, you would use the ________ button
A) Demote
B) Promote
C) Collapse
D) Expand
A
You might also like to view...
A programmer indicates a job’s class by coding a __________ parameter on an OS/JCL JOB statement.
a. positional b. CLASS c. PRIORITY d. none of the above
Use a recursive formula to define a static method to compute the nth Fibonacci number, given n as an argument. Your method should not use a loop to compute all the Fibonacci numbers up to the desired one, but should be a simple recursive method. Place this static recursive method in a program that demonstrates how the ratio of Fibonacci numbers converges. Your program will ask the user to specify how many Fibonacci numbers it should calculate. It will then display the Fibonacci numbers, one per line. After the first two lines, it will also display the ratio of the current and previous Fibonacci numbers on each line. (The initial ratios do not make sense.) The output should look something like the following if the user
5: Fibonacci #1 = 0 Fibonacci #2 = 1 Fibonacci #3 = 1; 1/1 = 1 Fibonacci #4 = 2; 2/1 = 2 Fibonacci #5 = 3; 3/2 = 1.5 The Fibonacci sequence occurs frequently in nature as the growth rate for certain idealized animal populations. The sequence begins with 0 and 1, and each successive Fibonacci number is the sum of the two previous Fibonacci numbers. Hence, the first ten Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, and 34. The third number in the series is 0 + 1, which is 1; the fourth number is 1 + 1, which is 2; the fifth number is 1 + 2, which is 3; and so on. Besides describing population growth, the sequence can be used to define the form of a spiral. In addition, the ratios of successive Fibonacci numbers in the sequence approach a constant, approximately 1.618, called the “golden mean.” Humans find this ratio so aesthetically pleasing that it is often used to select the length and width ratios of rooms and postcards. The recursive algorithm for Fibonacci numbers is a little more involved than the series calculations in the previous Projects. Base cases for 0, 1 or two numbers simply return a value, and all other numbers make two recursive calls to get the previous two Fibonacci numbers to add together to obtain the current number. The method to calculate a Fibonacci number is recursive, but the code to print the output is not; it uses a for-loop to cycle through the Fibonacci numbers and ratios.