Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement in C++ a game called Your Lucky Number. The lucky number is calculated based on an individuals birth month, day, and year. The algorithm

Implement in C++ a game called “Your Lucky Number”. The lucky number is calculated based on an individual’s birth month, day, and year. The algorithm assigns any person a number between 1 and 9. Many people believe that a group of people with the same lucky number share common features. The lucky number is calculated as the sum of digits of the birth month, day, and year numbers. If this sum is not a single digit then you need to keep adding up its digits. Use the C++ functions when you implement the game. Test your program for corrections. To start the game you should enter your full birthdate in the format: month day year, e.g. 9 21 1985. The month is represented by its corresponding integer: January is 1, February is 2, ..., and December is 12. Be sure that your program will verify the input format print an error message when the format is incorrect (use exceptions), and will ask to re-enter the birthdate again. The algorithm for calculating the lucky number


(a) Enter the month as an integer from 1 to 12.

(b) Reduce the month, day and year numbers down to a one-digit number by adding all digits in the month, day and year numbers, see the example below.

(c) Map the number to the category listed below and display the message on the screen with at least four features for a person in each category. I provided only one feature (as an adjective) for each category and you should complete the list.

(d) Test your program using at least 10 your friends’ or relatives’ birthdays.

Categories:

1. The Leader: original thinker (add 3 more features)

2. The Mediator: diplomatic (add 3 more features)

3. The Communicator: expressive (add 3 more features)

4. The Teacher: trustworthy (add 3 more features)

5. The Freedom Seeker: adventurous (add 3 more features)

6. The Nurturer: family-oriented (add 3 more features)

7. The Seeker: analytic (add 3 more features)

8. The Power House: authoritative (add 3 more features) 9. The Humanitarian: charitable (add 3 more features)


    

Step by Step Solution

3.28 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

Creating a C program for the Your Lucky Number game as described involves several steps including in... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linear Algebra

Authors: Jim Hefferon

1st Edition

978-0982406212, 0982406215

More Books

Students also viewed these Programming questions