1.The date June 10, 1960, is special because when it is written numerically,
the month time the day equals the year:
6/10/60 --> 6*10 = 60
Design a program that asks the user to enter a month (in numeric form), a day,
and a two-digit year in three separate inputs. The program should determine
whether the month times the day equals the year. If so, it should print,
"This date is magic!" Otherwise, it should print, "This date is not magic."
2.The colors red, blue, and yellow are known as the primary colors because they
cannot be made by mixing other colors. When you mix two primary colors, you get
a secondary color:
When you mix red and blue, you get purple.
When you mix red and yellow, you get orange.
When you mix blue and yellow, you get green.
Design a program that prompts the user to enter the names of two primary colors,
one at a time. If the user enters anything other than "red," "blue," or
"yellow," the program should print "You didn't input two primary colors."
Otherwise, it should print something in the format:
"When you mix red and blue, you get purple."
(Assuming the user entered "red" and "blue”.)
3.In mathematics, the notation n! represents the factorial of the nonnegative
integer n. The factorial of n is the product of all the nonnegative integers
from 1 to n. For example:
7! = 1 x 2 x 3 x 4 x 5 x 6 x 7 = 5,040
Write a program that lets the user enter a nonnegative integer and then uses
a loop to calculate the factorial of that number. Print the factorial to
4.Suppose you have a certain amount of money in a savings account that earns
compound monthly interest, and you want to calculate the amount that you will
have after a specific number of months. The formula is as follows:
f = p * (1 + i)^t
• f is the future value of the account after the specified time period.
• p is the present value of the account.
• i is the monthly interest rate.
• t is the number of months.
Write a program that takes the account's present value, monthly interest rate,
and the number of months that the money will be left in the account as three
inputs from the user. The program should pass these values to a function that
returns the future value of the account, after the specified number of months.
the program should print the account's future value.
|Due By (Pacific Time)||09/17/2015 11:59 pm|
out of 1971 reviews
out of 766 reviews
out of 1164 reviews
out of 721 reviews
out of 1600 reviews
out of 770 reviews
out of 766 reviews
out of 680 reviews