Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, help is really appreciated! I am a bit confused. The image below are the requirements for what is expected for the program. (C++) /////////////////////////////////////////////////////////////

Hi, help is really appreciated! I am a bit confused. The image below are the requirements for what is expected for the program. (C++)

/////////////////////////////////////////////////////////////

This is what it should be displayed

image text in transcribed

///////////////////////////////////////////////////////////////////////////

I have to use these modules

image text in transcribedimage text in transcribed

///////////////////////////////////////////////////////////

This is my current code at the moment. (C++)

#include #include

void input_data(int &month, int &year, int &day); void calculations(int month, int year, int day, int &jdn); void output_results(int &month, int &year, int &day, int &jdn);

void pause();

int main() { int day; int month; int year; int jdn; input_data(month, year, day); calculations(month, year, day, jdn); output_results(month, year, day, jdn); pause(); } // // A module that helps keep the console window open when using // Microsoft Visual Studio. // void pause();

void input_data(int &month, int &year, int &day) { std::cout > month; std::cout > day; std::cout > year; } void calculations(int month, int year, int day, int &jdn) { int a, m, y, leap_days; a = (14 - month) / 12; m = (month - 3) + (12 * a); y = year + 4800 - a; leap_days = (y / 4) - (y / 100) + (y / 400); jdn = day + (((153 * m) + 2) / 5) + (365 * y) + leap_days - 32045; } void output_results(int &month, int &year, int &day, int &jdn) { std::cout

} void pause() { // Omit these next two lines if your program doesn't get any input // from the user via the keyboard std::cin.clear(); std::cin.ignore(std::numeric_limits<:streamsize>::max(), ' '); std::cout Modity the program you created in the previous lab assignment so that it prompts the user to enter today's date and their birthday. Compute the JDN for both dates, the number of days between them, and the day of the week number for the user's birthday. The program should match the following sample as closely as possible (the underlined numbers in bold are examples of inputs made by the user your program will not underline the user's inputs or show them in bold): For today's date. Enter month number (Jan, Feb-2, etc.):2 Enter day number Enter year using four digits : 2019 For your birthday Enter month number (Jan=1, Feb-2, etc.) Enter day number Enter year using four digits : 1972 The JDN for 2/19/2019 is 2458534 The JDN for your birthday on 6/1/1972 was 2441470 The DOW on your birthday was 4 (o-Sun, l-Mon, etc.) It has been 17064 days since you were born Your program must include at least the following modules (when specified, you may not change the name or parameter list - the number of parameters, the type of each parameter, or their order - for any of these modules) get_date( An input module that retrieves the components of a date (month, day, year) from the user. The month is expected to be an integer from 1 to 12, the day an integer from 1 to 31, and the year a four-digit integer. As in v.2 of the "The Cricket as a Thermometer" handout, you may assume the user has been provided with information on the screen indicating what date should be entered (e.g., today's date or their birthday). You may also assume that the user enters valid numbers foir dates since 15 October 1582 compute_jdn(in year As Integer, in month As Integer, in day As Integer, out jdn As Integer) A processing module that computes the JDN for the given date compute_dow(in year As Integer, in month As Integer, in day As Integer, out dow As Integer) A processing module that computes the "day of the week" (DOW) number- an integer where 0 = Sunday, 1 = Monday, etc.-for the given date. The DOW is the remainder when ( JDN + 1 ) is divided by7 compute_days( A processing module that computes the number of days between two given JDNs. You may assume the JDN provided in the first parameter is less than or equal to the JDN provided in the second parameter display_date(in year As Integer, in month As Integer, in day As Integeir) An output module that displays the given date in the form "m/d/yyyy display_results( in today_jdn As Integer, ___, in birthday_jdn As Integer in birthday_dow As Integer, in days_between As Integer) An output module that displays today's date (as input by the user) and corresponding JDN, the user's birthday and corresponding JDN, the weekday number of the user's birthday, and number of days since the user was born. Modity the program you created in the previous lab assignment so that it prompts the user to enter today's date and their birthday. Compute the JDN for both dates, the number of days between them, and the day of the week number for the user's birthday. The program should match the following sample as closely as possible (the underlined numbers in bold are examples of inputs made by the user your program will not underline the user's inputs or show them in bold): For today's date. Enter month number (Jan, Feb-2, etc.):2 Enter day number Enter year using four digits : 2019 For your birthday Enter month number (Jan=1, Feb-2, etc.) Enter day number Enter year using four digits : 1972 The JDN for 2/19/2019 is 2458534 The JDN for your birthday on 6/1/1972 was 2441470 The DOW on your birthday was 4 (o-Sun, l-Mon, etc.) It has been 17064 days since you were born Your program must include at least the following modules (when specified, you may not change the name or parameter list - the number of parameters, the type of each parameter, or their order - for any of these modules) get_date( An input module that retrieves the components of a date (month, day, year) from the user. The month is expected to be an integer from 1 to 12, the day an integer from 1 to 31, and the year a four-digit integer. As in v.2 of the "The Cricket as a Thermometer" handout, you may assume the user has been provided with information on the screen indicating what date should be entered (e.g., today's date or their birthday). You may also assume that the user enters valid numbers foir dates since 15 October 1582 compute_jdn(in year As Integer, in month As Integer, in day As Integer, out jdn As Integer) A processing module that computes the JDN for the given date compute_dow(in year As Integer, in month As Integer, in day As Integer, out dow As Integer) A processing module that computes the "day of the week" (DOW) number- an integer where 0 = Sunday, 1 = Monday, etc.-for the given date. The DOW is the remainder when ( JDN + 1 ) is divided by7 compute_days( A processing module that computes the number of days between two given JDNs. You may assume the JDN provided in the first parameter is less than or equal to the JDN provided in the second parameter display_date(in year As Integer, in month As Integer, in day As Integeir) An output module that displays the given date in the form "m/d/yyyy display_results( in today_jdn As Integer, ___, in birthday_jdn As Integer in birthday_dow As Integer, in days_between As Integer) An output module that displays today's date (as input by the user) and corresponding JDN, the user's birthday and corresponding JDN, the weekday number of the user's birthday, and number of days since the user was born

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

Students also viewed these Databases questions

Question

What are the attributes of a technical decision?

Answered: 1 week ago

Question

How do the two components of this theory work together?

Answered: 1 week ago