Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C PROGRAMMING! Instructions: Follow the attached instructions and submit Part 1 and Part 2 on one c file. Hint: If you mod the birth year
C PROGRAMMING!
Instructions: Follow the attached instructions and submit Part 1 and Part 2 on one c file. Hint: If you mod the birth year by 12, then you will get a remainder between 0 and 11. Use this remainder as the control variable for a switch statement. If you find yourself writing 100 if statements, then you are going about the problem in the wrong way. Shared Programming Exam.pdf Objective The objective of this exam is to test your usage of decision statements, variables, input/output, random number generators, and the modulus operator. Learning Outcomes Using decision statements, such as IF/ELSE IF and switch Declaring variables Using rand and srand function Using the modulus operator Part 1: Chinese Zodiac: Create an application that will determine a user's animal sign and personality traits according to the Chinese zodiac. Animal signs are assigned based on a person's year of birth. For instance, if the user was born in 1982, then their animal sign is the Dog and are assumed to be very loyal. Use the following data to check your application. Do not display an animal sign if the user's date of birth is less than 1900 or greater than 2018. 0) Monkey: Very funny and good problem solvers! 1) Rooster: Talented and hard workers! 2) Dog: Very Loyal and can keep a secret! 3) Pig: Good students, honest and brave! 4) Rat: Very popular! 5) Ox: Dependable and calm! 6) Tiger: Brave and respected! 7) Rabbit: Nice to be around! 8) Dragon: Good health and lots of energy! 9) Snake: Good luck with money! 10) Horse: Popular, cheerful, and quick to compliment others! 11) Ram: Good Artists! Part 2: Lottery numbers: Generate six random integers and display them to the user. Each number should be between 1 and 54. Disclaimer: Do not worry if the numbers repeat themselves. You will still receive full credit for your work. Submission: You may write part 1 and part 2 on the same source.cpp file. Submit the source.cpp file. Output (correct input) ANIMAL SIGN & LOTTERY NUMBERS Enter your birth year (1900-2018): 1982 Dog: Very Loyal and can keep a secret! Lottery Numbers: 3 32 45 10 32 18 Output (incorrect input) ANIMAL SIGN & LOTTERY NUMBERS Enter your birth year (1900-2018): 1820 Enter another year between 1980 and 2018 Lottery Numbers: 48 54 4 14 36 10Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started