You are expected to complete the project individually. A project report (see the attached template) should be submitted
Posted: Sat May 14, 2022 7:29 pm
You are expected to complete the project individually. A project report (see the attached template) should be submitted to D2L before the due date: You may also present your work with a video for an extra 10 points bonus. (Chinese Zodiac) Chinese Zodiac. which means "birth likeness") is a scheme and systematic plan of future action that relates cach year to an animal and its reputed attributes, according to a 12-year cycle. It remains popular in several East Asian countries, such as China, Vietnam, Korea and Japan pig rat dog OX TO Oster tiger year% 12 - *0: monkey 1: rooster 2: dog 3: pig 4: rat 5: Ox 6: tiger 7: rabbit 8: dragon 9: smake 10: horse 11: sheep monkey rabbit sheep dragon horse sake In Chapter 3: we showed a program that prompts the user to enter a year and displays the animal for the year. The original code is posted below: import java.util.Scanner public class Chinese Zodiac
In Chapter 3, wc showed a program that prompts the user to enter a year and displays the animal for the year. The original code is posted below: import java.util.Scanner public class ChinescZodiac public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a year: "); int year - input nextinto: switch (year % 12) case 0: System.out.println("monkey"); break; case 1: System.out.println("rooster"); break; case 2: System.out.println("dog"); break; case 3: System.out.println("pig"); break; case 4: System.out.println("rat"); break; case 5: System.out.println("ox"); break; case 6: System.out.println("tiger"); break; case 7: System.out.println("rabbit"); break; case 8: System.out.println("dragon"); break; case 9: System.out.println("snake"); break; case 10: System.out.println("horse"); break; case 11: System.out.println("sheep"); break; In this project you are expected to do the following you may use either procedural or object-oriented programming
b. (Find the enemy) Every zodiac animal has an enemy. A zodiac animal's enemy is at the opposite side of the zodiac wheel (see the above figure). For example, Horse's enemy is rat, and pig's enemy is snake. To find animal X's enemy, use the following formula: Prompts the user to enter a year in the main method and create a method called enemy that will display the name of the corresponding enemy (NOT the year of the enemy). C. (Find the pack) Prompts the user to enter a year and displays the years of that animal between a given year range. Your code should also prompt the user to input the starting year and the ending year of the range. For example, 2014 is the year of Horse. The years of Horse between 1950 and 2050 are: 1954, 1966, 1978, 1990, 2002, 2014, 2026, 2038, and 2050 d. (A complete program) Combine the original code and your codo in a), b) and e) to generate a program, which prompts the user to enter a year and displays the animal for the year, the animal's enemy: and years of that animal in a given year range. (Note: you program should be reasonably concise. Do not repeat a code block.) Here are the sample runs: <Outpur Enter a year 1995 The year of 1995 is: pig And it's enemy is snake For the pack, enter a starting year: 1950 For the pack, enter an ending year: 2050 The years of it's pack between 1950 and 2050 are 1959 1971 1983 1995 2007 2019 2021 2043 <End Output
In Chapter 3, wc showed a program that prompts the user to enter a year and displays the animal for the year. The original code is posted below: import java.util.Scanner public class ChinescZodiac public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a year: "); int year - input nextinto: switch (year % 12) case 0: System.out.println("monkey"); break; case 1: System.out.println("rooster"); break; case 2: System.out.println("dog"); break; case 3: System.out.println("pig"); break; case 4: System.out.println("rat"); break; case 5: System.out.println("ox"); break; case 6: System.out.println("tiger"); break; case 7: System.out.println("rabbit"); break; case 8: System.out.println("dragon"); break; case 9: System.out.println("snake"); break; case 10: System.out.println("horse"); break; case 11: System.out.println("sheep"); break; In this project you are expected to do the following you may use either procedural or object-oriented programming
b. (Find the enemy) Every zodiac animal has an enemy. A zodiac animal's enemy is at the opposite side of the zodiac wheel (see the above figure). For example, Horse's enemy is rat, and pig's enemy is snake. To find animal X's enemy, use the following formula: Prompts the user to enter a year in the main method and create a method called enemy that will display the name of the corresponding enemy (NOT the year of the enemy). C. (Find the pack) Prompts the user to enter a year and displays the years of that animal between a given year range. Your code should also prompt the user to input the starting year and the ending year of the range. For example, 2014 is the year of Horse. The years of Horse between 1950 and 2050 are: 1954, 1966, 1978, 1990, 2002, 2014, 2026, 2038, and 2050 d. (A complete program) Combine the original code and your codo in a), b) and e) to generate a program, which prompts the user to enter a year and displays the animal for the year, the animal's enemy: and years of that animal in a given year range. (Note: you program should be reasonably concise. Do not repeat a code block.) Here are the sample runs: <Outpur Enter a year 1995 The year of 1995 is: pig And it's enemy is snake For the pack, enter a starting year: 1950 For the pack, enter an ending year: 2050 The years of it's pack between 1950 and 2050 are 1959 1971 1983 1995 2007 2019 2021 2043 <End Output