Question: Programming Exercise 3.5 My Days Purpose. Learn how to write a program that solves a problem, from scratch, according to a supplied algorithm. It also

 Programming Exercise 3.5 My Days Purpose. Learn how to write a

Programming Exercise 3.5 My Days Purpose. Learn how to write a program that solves a problem, "from scratch", according to a supplied algorithm. It also get you to do a little bit of research and preparation before doing any programming, which is a programming discipline that it will be important for you to develop. Requirements. Write a program named myDays.cpp to calculate how many days old you will be on the due date for this lab. You do not have to use your true birth date, but it should be more than 10 years ago and less than 100. You do have to look up the due date and apply it correctly. To prepare you will need to figure out: 1. the number of years in which you've lived, including your birth year and the current year 2. the number of leap years in your life 3. the number of days in your birth year before you were born, including your day of birth 4. the number of days remaining in the current year after the due date for this lab, excluding that date. Write these all down on a piece of paper for your reference when you write the program. For the example shown below, these numbers are 22, 5, 151, and 102, respectively. Algorithm. Create an integer variable "days" to track the number of days of age, and initialize it to zero. Add to "days" the result of this multiplication: 365 times the number of years in which you've lived. Add to "days" the number of those years that were leap years. Subtract from "days" the number of days in your birth year before you were born. Subtract from "days" the number of days remaining in the current year after the due date. Output the value of "days" with an appropriate label. Program I/O. Input: the 4 programmer-assigne whole number values listed in the requireme as calculated by you. Output: Three lines: one showing your date of birth, one showing the due date, and one with your calculated age in days. Example. The 3 lines of output should look something like this, labeled as you wish, with your program's values: DOB: May 31, 1993 Due: Sept 20, 2014 Age: 7782 days Programming Exercise 3.5 My Days Purpose. Learn how to write a program that solves a problem, "from scratch", according to a supplied algorithm. It also get you to do a little bit of research and preparation before doing any programming, which is a programming discipline that it will be important for you to develop. Requirements. Write a program named myDays.cpp to calculate how many days old you will be on the due date for this lab. You do not have to use your true birth date, but it should be more than 10 years ago and less than 100. You do have to look up the due date and apply it correctly. To prepare you will need to figure out: 1. the number of years in which you've lived, including your birth year and the current year 2. the number of leap years in your life 3. the number of days in your birth year before you were born, including your day of birth 4. the number of days remaining in the current year after the due date for this lab, excluding that date. Write these all down on a piece of paper for your reference when you write the program. For the example shown below, these numbers are 22, 5, 151, and 102, respectively. Algorithm. Create an integer variable "days" to track the number of days of age, and initialize it to zero. Add to "days" the result of this multiplication: 365 times the number of years in which you've lived. Add to "days" the number of those years that were leap years. Subtract from "days" the number of days in your birth year before you were born. Subtract from "days" the number of days remaining in the current year after the due date. Output the value of "days" with an appropriate label. Program I/O. Input: the 4 programmer-assigne whole number values listed in the requireme as calculated by you. Output: Three lines: one showing your date of birth, one showing the due date, and one with your calculated age in days. Example. The 3 lines of output should look something like this, labeled as you wish, with your program's values: DOB: May 31, 1993 Due: Sept 20, 2014 Age: 7782 days

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!