Its to be written in c you will be writing a program that


It's to be written in C++. You will be writing a program that will prompt the user for a date and a time. For the date, the user will be asked to enter in three integers (month, day, year). There will be four functions related to the date:

1.string getMonth() - Prompts the user for an integer resembling the month.

The function should then check the integer value and return the string

correlated to the month.

2.int getDay() - Prompts the user for an integer resembling the day and returns

the integer.

3.int getYear() - Prompts the user for an integer resembling the year and returns

the integer.

4.void displayDate(string month, int day, int year) - Displays the date in this

format: October 18, 2012

Next, the user will be asked to enter the time, which is to be then converted from military time and displayed. There will be three functions related to the time:

int getHours() - Prompts the user for an integer resembling the hour of the day in military time. If the user enters 23, the function should return 11. If the military time entered is >=12, set the global boolean variable PM to be true, else false. int getMinutes() - Prompts the user for an integer resembling the minutes and returns that integer. void displayTime(int hour, int min) - This function will check if the global boolean variable PM is true. If it is true, display the time in this format: 12:34 PM. If PM is false, display the time as so: 11:34 AM

For each "get" function, there should be an input-validation loop. The purpose for this lab is to allow you to become more comfortable with declaring functions, calling functions, and defining functions.

The output should be similar to the following:

Please enter in the month: 10

Please enter the day of the month: 18

Please enter the year: 2012

Please enter the hour in military format: 23

Please enter the number of minutes: 34

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Its to be written in c you will be writing a program that
Reference No:- TGS01146059

Expected delivery within 24 Hours