I'm new to C++ and currently enrolled in an intro class. Due to some uncontrollable events I have fallen behind in the class. Would appreciate help with the following:

CSIT 575 – Programming Fundamentals for Computer Science Lab #3A

Objectives:

To learn to code, compile and run a program containing SELECTION structures

Assignment:

A. Plan and code a C++ program utilizing the if-then-else structure to solve the following:

B. Write an interactive C++ program to determine the day of the week for any given date from 1900-2099. Following are the steps you should use:

C. Input the date in 3 separate parts, month, day and 4-digit year. Error check to make sure the month is between 1 and 12, the day between 1 and 31, and the year between 1900-2099. If there is an error, identify the type of error and stop the program.

D. If the data is good, divide the last two digits of the year by 4. Store the quotient (ignoring the remainder) in Total. For example, for 1983, divide 83 by 4 and store 20 in Total.

E. Add the last 2 digits of the year to Total.

F. Add the two digits of the day of the month to Total.

G. Using the following table, find the "value of the month" and add it to Total.

January = 1 May = 2 September = 6

February = 4 June = 5 October = 1

March = 4 July = 0 November = 4

April = 0 August = 3 December = 6

H. If the year is 2000 or later, add 6. If the year is 2000 exactly and the month is January or February, subtract 1.

I. Then, determine if the year is a leap year. A leap year is divisible by 4 but not divisible by 100. If it is a leap year and the month is January or February, subtract 1. (The year 2000 is NOT a leap year).

J. Find the remainder when the Total is divided by 7. Use the remainder to find the day:

1= Sunday 3 = Tuesday 5 = Thursday

2 = Monday 4 = Wednesday 6 = Friday

0 = Saturday

Input

Your three initials, the month, day, and 4-digit year of the date to analyze.

Output

All of the input fields, a message if the data is OK and the day of the week of the date. Output the date and the appropriate error message if the data is bad.

Turn in

Program listing and program output.

Test today’s date, your birthdate, and the dates your instructor gives you and error conditions.

CSIT 575 – Programming Fundamentals for Computer Science Lab #3A

Objectives:

To learn to code, compile and run a program containing SELECTION structures

Assignment:

A. Plan and code a C++ program utilizing the if-then-else structure to solve the following:

B. Write an interactive C++ program to determine the day of the week for any given date from 1900-2099. Following are the steps you should use:

C. Input the date in 3 separate parts, month, day and 4-digit year. Error check to make sure the month is between 1 and 12, the day between 1 and 31, and the year between 1900-2099. If there is an error, identify the type of error and stop the program.

D. If the data is good, divide the last two digits of the year by 4. Store the quotient (ignoring the remainder) in Total. For example, for 1983, divide 83 by 4 and store 20 in Total.

E. Add the last 2 digits of the year to Total.

F. Add the two digits of the day of the month to Total.

G. Using the following table, find the "value of the month" and add it to Total.

January = 1 May = 2 September = 6

February = 4 June = 5 October = 1

March = 4 July = 0 November = 4

April = 0 August = 3 December = 6

H. If the year is 2000 or later, add 6. If the year is 2000 exactly and the month is January or February, subtract 1.

I. Then, determine if the year is a leap year. A leap year is divisible by 4 but not divisible by 100. If it is a leap year and the month is January or February, subtract 1. (The year 2000 is NOT a leap year).

J. Find the remainder when the Total is divided by 7. Use the remainder to find the day:

1= Sunday 3 = Tuesday 5 = Thursday

2 = Monday 4 = Wednesday 6 = Friday

0 = Saturday

Input

Your three initials, the month, day, and 4-digit year of the date to analyze.

Output

All of the input fields, a message if the data is OK and the day of the week of the date. Output the date and the appropriate error message if the data is bad.

Turn in

Program listing and program output.

Test today’s date, your birthdate, and the dates your instructor gives you and error conditions.

Do you have a specific question or did you just wanted to share the assignment?

There are plenty of tutorials on the net, and here on this site to get you started.

Go documentation and then C++ language tutorial. I suggest you try first and then post your problems

There are plenty of tutorials on the net, and here on this site to get you started.

Go documentation and then C++ language tutorial. I suggest you try first and then post your problems

Was stressed out because I'm playing catch up. I'll see what I can come up with and post back here when Ive figured something out or if Im having trouble.

Topic archived. No new replies allowed.