Question: 1. Write a program that calculates the area and perimeter of a rectangle. The side lengths should be inputted by the user. The area and
1. Write a program that calculates the area and perimeter of a rectangle. The side lengths should be inputted by the user. The area and perimeter of the rectangle should be calculated and returned using 2 user defined functions,area & perimeterand then outputted as shown below. Note that 5.6 and 9.8 are only examples.
2.Write a program that calculates the difference in velocity of objects starting to fall for a time in seconds on Earth and on Jupiter. The time in seconds should be inputted by the user and output should look as shown below. The gravitational acceleration on Earth is 9.81 meters per second squared and on Jupiter is 25.95. The formula for calculating velocity is (v = gt); or velocity equals gravity times time. Note that the underlined value displayed in the output below is the user input.
4.Create a function that is passed 2 Integers (named prevFib and currFib) which will be incremented to the next 2 values in the Fibonacci sequence. Fibonacci Sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ...
5. Create a function called isGold that is passed 2 floats (named dividend and divisor) and returns true if the product of the division is approximately
the Golden Ratio to 3 decimal places (1.618).
6.Create a function named intDivision that is passed 2 Integers (named dividend and divisor). The function will assign the product of the division to the dividend and return the remainder.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
