Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In netbeans and C++ please void getinput (int smonth, int sday, int syeaz) bool isteapYear (int year) int getCenturyValue(nt year)s int getTearValue(int year) int getMonthValue(int

image text in transcribed
image text in transcribed
In netbeans and C++ please
void getinput (int smonth, int sday, int syeaz) bool isteapYear (int year) int getCenturyValue(nt year)s int getTearValue(int year) int getMonthValue(int month, int year) string dayOfWeek(int month, int day, int year) The getinput ) function should read in the month day, and ycar from the keyboard. Assume, however, that the month is entered in vaa text ta cit ar full or abbreviated form For =stance, February could be input as either "Feb" or "Tebruary- Therefore-the ct on must also convert the string for the month into an appropriate integer value since the call by reference value to store the month uses an integer (not a string) reference. Finally, the function should also be able to read in the comma after the day and discard it The isLeaptear) function returns a boolean vale that is true if the year is a leap year and false if it is not a leap year. The pseudocode to determine a leap year is given by leapYear(year divisible by 400) OR (year divisible by AND year not divisible by 100) The getCenturyvalue ( ) faction should take the first two ofthe year variable (that is, the century), divide by 4, and save the remainder. The remainder should then be subtracted froem 3 and the subsequent value multiplied by 2. For example, the year 2008 becomes: (204)-5 with a remainder of 0. 3-0-3. Retam 3 2-6 The getrearValue) function computes a valae based on the years since the beginning of the century. First, extract the last two digits of the year. For example, 08 is extracted for 2008. Save this valuc. Next, divide the value from the previous slcp by 4 and discard the remainder. Add the two results together and return the result. For example, from 2008 we extract 08. Then (8/4)-2 with remainder of 0. Return 2+8-10 The getMonthvalue) function returms a value bassed on the table below, and will roquire invoking the isteapTear) function Month April June October Finally, the dayOfWeek) function should be used to compute the day of the week. The weekday is computed by the sum of the date's day plus the valucs returned by the getMonthValue) get Yearvalue()" and getCenturyvalue( )toes. D vidr the sum by 7 and compute the remainder. A remainder of 0 corresponds to Sunday, 1 corresponds to Monday, etc, up to 6, which corresponds to Saturday. For example, the date July 4, 2008 should be computed as (day of month) + (getMonthValuc)(get YearValuc)+(getCenturyValuc)-4+6+10+6- 26 267-3 with a remainder of 5The 5. day ofthe week corresponds to Friday Return this value as a string. Again, note the requirement of declaring "using nanespace std; before your function peototypes, otherwise std:istring will be required to access the string data types. Likewise, the setw() and setfil11) functions will have to be used as well when printing the date in mm/dd/yy format

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

2. How much time should be allocated to the focus group?

Answered: 1 week ago

Question

1. Where will you recommend that she hold the focus group?

Answered: 1 week ago