Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that, given a person's birth date, display the day of the week the person was born. The program will read in

image text in transcribed
image text in transcribed
image text in transcribed
Write a C++ program that, given a person's birth date, display the day of the week the person was born. The program will read in a number of birthdays from a data file using Imput Redirect. For this assignment, we assume that all the dates present in the data file are valid, i.e., no negative value is entered, no month value of greater than 12 or less than 1 is entered, etc. Create a directory named "OLA6" under the "OLA" directory. Put all the files relate to this assignment in the OLA6 directory. Copy the data file into the OLA directory using the following ep cen data/birthday dat E notice the trailing period There is no startup template program to copy for this assignment. Name your program weekday.epp The data file looks like the following: 6 15 1988 119 1992 1 29 1991 2 2 1980 1 20 1997 0 1 2017 10 16 1996 6 15 1970 4 8 1953 4 10 1999 1 20 2000 The output of your program should be: Wednesda Monda Tuesday Saturday Monday Sunday Wednesday Monday Wednesday Saturday Thursday How to determine the day of the week one was born. We use the formula called the: Zeller's Rule to compute the day of the week for a person's birthday. The following formula is named Zeller's Rule after the Reverend Zeller. Here's the formula: f-d + (13*m-1/5+D D/4+C/4-2*C ll variables are declared as integer type d is the day of the month. Let's use January 29, 2064 as an example. For this date, d 29 . m is the month number. Months have to be counted in a special way for Zeller's Rule: March is 1, April is 2, and so on to January is 11, and February is 12. (This makes the formula simpler, because on leap years February 29 is counted as the last day of the year.) Because of this rule, January and February are always counted as the 11th and 12th

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

Students also viewed these Databases questions