Write a program that calculates Fibonacci numbers, as defined in section 2.4, definition 5.
Demonstrate your code by calculating the 3, 5, and 10th Fibonacci numbers.
You should turn in a brief report by the end of class. Your
report should include:
• 5 points: Your name
• 20 points:A single question describing what the question is
asking
• 10 points:A list of other useful resources and references.
• 10 points:A list of key assumptions and general
observations
• 10 points:A copy of your calculations and other work
• 25 points:Your code
• 10 points:Your code output
• 10 points:A discussion of your solution, and why you believe it
is correct
Use any language
Solution for the above question are as follows -
Code :
#include<stdio.h>
int main()
{
// local variable declaration
int n, i = 0, j;
// get input from user
printf("Enter number : ");
scanf("%d", &n);
// call to Fibonacci function and print the series
printf("Fibonacci series : ");
for (j = 1; j <= n; j++)
{
printf("%d ", fibonacci(i));
i++;
}
return 0;
}
// fibonacci - this function check the n variable value and
recursively call to itself and return int value
int fibonacci(int n)
{
if (n < 0)
return 0;
else if (n == 0 || n == 1)
return n;
else
return (fibonacci(n-1) + fibonacci(n-2));
}
Code Screen Shot :

Output :


Write a program that calculates Fibonacci numbers, as defined in section 2.4, definition 5. Demonstrate your...
Please answer this python questions.Thank you! Question Two Write a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, and then show the total pay at the end...
(Demonstrate the Box class from above in a program), (Extra 5 Credits ). Re-use your code from the previous question, add the following functions. Each function worth 1 point. You dont have to implement in order. 1) Overloaded cout’s << that displays attributes of a box. Also overload cin’s >> operator to work with this class for constructing a Box instance using values supplied as console inputs. 2) Overloaded == operator as a member function that returns true if two...
Complete the missing parts of java source code //This program calculates a running total. Here is the problem definition //Data Express, an Internet Service Provider, has requested that you develop a program to allow //sales representatives to calculate a running total of their sales based on a number of days. //The program prompts the salesperson “How many days do you have sales figures? “. //The number of days must be between 1 – 4 days (keep asking the user until...
3. You should test your program on other test cases (tdhat you make up) as well. Making up good test cases is a valuable programming skill, and is part of ensuring your code solution is correct. Problem A: Number game (20 points) Write a C++ program that will play the following game. Ask the user how many "rounds" you want to play and start at 10 points. Every turn you can add either 1 point (by choosing "a or 2...
PROJECT TASKS 1. Read the problem definition below and write a C++ program that implements your solution. Readability of the program will be graded based on variable naming, indentation, commenting (not too little and not too much), spacing, consistency, and styling in general including choice of functions. [NOTE: the code at the end of this document does not completely meet requirements as it uses many single letter variables and has no internal documentation. You need to improve it.] 2. Compile...
(10 marks) Question 1 Class Definitions la) (5 marks) Write information on Java class called IdentityCard to represent the the identity card of a member of an organisation. For example a UWA student card. Include brief comments in your class necessary, but full Javadoc is not required. State any a. definition as assumptions you make. The class should have: four fields that capture the person's name, identity number, photo, and whether the person is a current member of the organisation;...
Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....
Below are a list of sequences of numbers. Your job is to program each sequence with any loop of your preference (while, for, do/while). I want the code to output the sequence provided and the next number in the sequence (you can output more but there is 1 sequence that may only have 1 number after). Each sequence should be in the same main in one .cpp file. . Please order and notate each sequence in your output –. The...
Part B (BI). Implement a Red-Black tree with only operation Insert(). Your program should read from a file that contain positive integers and should insert those numbers into the RB tree in that order. Note that the input file will only contain distinct integers. Print your tree by level using positive values for Black color and negative values for Red color Do not print out null nodes. Format for a node: <Node_value>, <Parent_value>). For example, the following tree is represented...
Instructions: For this assignment, you will write the first part of a program that allows a customer to plan for retirement. Note: This program has no user input Write a "pure" Python function named 'calc_final_balance' that calculates the final balance in a retirement account after annual savings accrue for and earn interest for a number of years. This is a simulation problem similar to the Credit Card sample program, except it is to be written as a function definition (which...