SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 314 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 16 Dec 2017 My Price 10.00

program, you will store a calendar month of dates

Hello! i need some help with assignment, its been giving me alot of trouble, thank you !

CIS1111 Topic 14 – 2-Dimensional Arrays

Calendar

In this program, you will store a calendar month of dates (numbers starting at 1) in a two-dimensional array. Some months have 31 days, others 30, and February has 28 (29 if it’s a leap year, which is a year divisible by 4).

Here is a list of Months, the number of Days in each month, and the Day on which each Month Starts, in 2016, 2017, 2018, and 2019:

                                                                                Day on which Month Starts                        

Months                                Days      2016                       2017                       2018                       2019

January                                31           Friday                    Sunday                 Monday               Tuesday
February              28*         Monday               Wednesday        Thursday             Friday

March                   31           Tuesday               Wednesday        Thursday             Friday

April                       30           Friday                    Saturday              Sunday                 Monday

May                       31           Sunday                 Monday               Tuesday               Wednesday

June                      30           Wednesday        Thursday             Friday                    Saturday

July                        31           Friday                    Saturday              Sunday                 Monday

August                  31           Monday               Tuesday               Wednesday        Thursday

September         30           Thursday             Friday                    Saturday              Sunday

October               31           Saturday              Sunday                 Monday               Tuesday

November          30           Tuesday               Wednesday        Thursday             Friday

December           31           Thursday             Friday                    Saturday              Sunday

*except leap year

 

Given a month name, the name of the starting day of the week, and the year, write a program to store the date (number) of each day in the corresponding array location. Use a two-dimensional array called month of type int to store the generated month dates.

1.       Declare month to bean array of typeint of the proper size and dimensions (weeks and days), and initialize all elements to 0.

2.       Handle user input as follows:

a.       Ask the user for the month name, and match it to the appropriate number of days (hint: use parallel arrays)

b.      If the month is February, you need to know the year, and test if it is a leap year to adjust February’s number of days, if needed.

c.       Ask the user which day of the week the month starts on, and match it to the proper day number (Sunday being day 1), to determine which position in the two-dimensional array to start storing dates (hint: use parallel arrays)

3.       Use formatted output to display the month left-aligned, omitting “0” dates (see the output example below)

4.       Use functions if desired. Allow your main program to loop, allowing the user to ask for an unlimited number of months.

 

 

 

 

Requirement

Point value

Used a 2-dimensional array of the proper type, size, and initialized to 0

2

Handled user input, accounted for invalid input, ask for the proper information as needed

3

Generated the month correctly, on the correct day of the week, with the correct number of days

6

Functions and variables were named clearly, and code was well documented

4

Output was clear and correctly formatted

5

Total

20

 

 

Attachments:

Answers

(5)
Status NEW Posted 16 Dec 2017 06:12 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)