Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: This program does not require a while loop. Also, you are not allowed to use the sys.exit() function to cause your program to prematurely

image text in transcribedimage text in transcribed

Note: This program does not require a "while" loop. Also, you are not allowed to use the "sys.exit() function to cause your program to prematurely quit. You have been hired by a reality show casting company to write a program that will be used to ensure that their contestants are at least 21 years of age by the start of a show. Your task is to write a simple program that prompts the user to enter two values: the start date of a show and the birth date of a candidate. The user will enter dates using the following format: MMDDYYYY Your program should then generate the following output: The candidate's birthday in the following format: December 1st, 2000 . Whether the candidate is eligible to be on the reality show or not. Eligible candidates must be 21 years of age or older as of the time of the taping of the show. Here are a few sample runnings of the program: Instructions: Enter the start date and birthdate for an employee to determine their age at the start of employment. Enter start date MMDDYYYY: 05012016 Enter birth date MMDDYYYY: 01012000 The contestant was born on January 1st, 2000 NOT ELIGIBLE: The contestant won't be 21 by the time taping begins >>> RESTART WWWWWWWWWWWWWWWWW Instructions: Enter the start date and birthdate for an employee to determine their age at the start of employment. Enter start date MMDDYYYY: 05012016 Enter birth date MMDDYYYY: 04051995 The contestant was born on April 5th, 1995 ELIGIBLE: The contestant will be 21 by the time taping begins >>> WWW WWW RESTART W SH Instructions: Enter the start date and birthdate for an employee to determine their age at the start of employment. Enter start date MMDDYYYY: 05012016 Enter birth date MMDDYYYY: 05012016 The contestant was born on May 1st, 2016 NOT ELIGIBLE: The contestant won't be 21 by the time taping begins >>> WWWWWWWWWWWWWW RESTART WWWWWWWWWWWWW Instructions: Enter the start date and birthdate for an employee to determine their age at the start of employment. Enter start date MMDDYYYY: 05012016 Enter birth date MMDDYYYY: 05011995 The contestant was born on May 1st, 1995 ELIGIBLE: The contestant will be 21 by the time taping begins >>> BB RESTART Instructions: Enter the start date and birthdate for an employee to determine their age at the start of employment. Enter start date MMDDYYYY: 05012016 Enter birth date MMDDYYYY: 05021995 The contestant was born on May 2nd, 1995 NOT ELIGIBLE: The contestant won't be 21 by the time taping begins Here are some hints: You can assume that the user will always enter a valid date using the MMDDYYYY format To extract the year, month and day from a date it may be helpful to revisit some of the math operations we covered during Assignment #2 You will need to find a way to convert a numeric value (i.e. "10") into a month value (i.e. "October"). Hint: you may need a few "if" statements to do this! . Depending on the day of the month you may have to use a different label when printing the date (i.e. May 1st, May 2nd, May 3rd, May 4th, May 5th, May 21st, May 22nd, May 23rd and May 31st) When computing the age of a candidate you should first look at your "year" values. If you can make a determination as to whether a candidate is eligible using this information then that's great! If not, you may need to look at the month and day values. For example, in the following sample run the user will be 20 years old as of the "start date": Instructions: Enter the start date and birthdate for an employee to determine their age at the start of employment. Enter start date MMDDYYYY: 05012016 Enter birth date MMDDYYYY: 05021995 The contestant was born on May 2nd, 1995 NOT ELIGIBLE: The contestant won't be 21 by the time taping begins

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Algorithmic Trading Navigating The Digital Frontier

Authors: Alex Thompson

1st Edition

B0CHXR6CXX, 979-8223284987

More Books

Students also viewed these Databases questions

Question

Explain the various methods of job evaluation

Answered: 1 week ago

Question

Differentiate Personnel Management and Human Resource Management

Answered: 1 week ago

Question

Describe the functions of Human resource management

Answered: 1 week ago