asked 119k views
1 vote
For this assignment, you will create a calendar program that allows the user

to enter a day, month, and year in three separate variables as shown below.
Day:
Month:
Year:
Then, your program should ask the user to select from a menu of choices
using this formatting
Menu:
1) Calculate the number of days in the given month.
2) calculate the number of days left in the given year.

1 Answer

4 votes

To create a calendar program that allows the user to enter a day, month, and year and perform calculations based on the menu options provided, you will need to use variables, display a menu of choices, and write code to perform the calculations based on the user's selection.

Calender Program

To create a calendar program that allows the user to enter a day, month, and year, you will need to use variables to store the user's input. Here is an example of how to do it:

Day: int day = 15;

Next, you need to display a menu of choices to the user. Here is an example:

Menu:
1) Calculate the number of days in the given month.
2) Calculate the number of days left in the given year.

Then, depending on the user's choice, you can calculate the number of days in the given month or the number of days left in the given year. For the first option, you can use a switch statement to determine the number of days based on the month. For the second option, you can calculate the number of days left in the year by subtracting the current day from the total number of days in the year.

answered
User Oscar Calderon
by
8.1k points

No related questions found