Create a program that will ask the user the type a year and display the Chinese Zodiac animal for the entered year. The program should: Ask the user to enter a year and save the entered year in a variable as an integer. The year as to be between 1936 and 2050. If the user entered a year that is not within the range, the program will display an invalid message as: is an invalid year On the other hand, if the year is between 1936 and 2050, then the program will use the following formula to find the remainder of the year: (year-1936)%12 Using the formula above, it should provide you 12 different remainders. After it, use the following table to display the message according to the remainder: Remainder Message 0 Year ______ is the year of Rat 1 Year ______ is the year of Ox 2 Year ______ is the year of Tiger 3 Year ______ is the year of Rabbit 4 Year ______ is the year of Dragon 5 Year ______ is the year of Snake 6 Year ______ is the year of Horse 7 Year ______ is the year of Goat 8 Year ______ is the year of Monkey 9 Year ______ is the year of Rooster 10 Year ______ is the year of Dog 11 Year ______ is the year of Pig Template When run the program, it will ask the user to type a year If the user types 1990 and hits Enter, the program will calculate the remainder using the entered year and show a message according to the table above
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Create a
the entered year.
The program should:
Ask the user to enter a year and save the entered year in a variable as an integer. The year
as to be between 1936 and 2050. If the user entered a year that is not within the range, the
program will display an invalid message as:
is an invalid year
On the other hand, if the year is between 1936 and 2050, then the program will use the
following formula to find the remainder of the year:
(year-1936)%12
Using the formula above, it should provide you 12 different remainders.
After it, use the following table to display the message according to the remainder:
Remainder Message
0 Year ______ is the year of Rat
1 Year ______ is the year of Ox
2 Year ______ is the year of Tiger
3 Year ______ is the year of Rabbit
4 Year ______ is the year of Dragon
5 Year ______ is the year of Snake
6 Year ______ is the year of Horse
7 Year ______ is the year of Goat
8 Year ______ is the year of Monkey
9 Year ______ is the year of Rooster
10 Year ______ is the year of Dog
11 Year ______ is the year of Pig
Template
When run the program, it will ask the user to type
a year
If the user types 1990 and hits Enter, the program
will calculate the remainder using the entered year
and show a message according to the table above
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images