Programming I COMP 150
Popular in Course
Popular in ComputerScienence
This 1 page Class Notes was uploaded by Ashlynn Bergstrom on Monday October 12, 2015. The Class Notes belongs to COMP 150 at Harding University taught by Staff in Fall. Since its upload, it has received 17 views. For similar materials see /class/222132/comp-150-harding-university in ComputerScienence at Harding University.
Reviews for Programming I
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/12/15
Program 3 Calendar 100 Points Write a C program called calendarcpp that will produce a calendar for a given month and year The user will be able to produce calendars until 0 is entered for the month All user input should be validated Your program should produce output exactly like the example below To determine which day of the week a calendar should start on Enter month gag orbo toqugg 4 considerthe factthat Jan 1 1900 was on a Monday That n er year or a ove means Feb 1 1900 would be on Thurs since there are 31 days April 2000 in Jan and Jan 315 was on a Wed Mar 1 1900 would begin on Thurs since there are 28 days in Feb and Feb 28 h was on a Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 5 7 8 I I I 9 10 11 12 13 14 15 The foowrng formula can be used for calculating which day of 16 l7 18 19 20 21 22 the weekthe 15 would fall on for a particular month and year 23 24 25 25 27 28 29 30 First Day Remainder of 1 Tota Number of Days from Jan 1 Enter month 1712 or 0 to quit 1 1900 to 15 of current Month7 Enter year 1900 or above 1900 J where First Day of 0 is Sun 1 is Mon 2 is Tues 6 is Sat anuary 1900 Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 7 8 9 10 11 12 13 Example 14 15 15 17 18 19 20 I 21 22 23 24 25 26 27 FIrst Day for Mar 1900 Remainder of 1 31 28 7 4 which 28 29 30 31 corresponds to Thurs Enter month 1712 or 0 to quit 0 In calculating the total number of days since Jan 1 1900 it is necessary to add a day to Feb for Leap Years If the number of the year is divisible by 4 then the year is a Leap Year except in the case where the number of the year ends in 00 then the year is not a Leap Year However if the number of the year ends in 00 and the year is divisible by 400 the year is a Leap Year Notes about output 0 Each day is separated by 2 spaces 8110771400 The right edge of the month and year output quotJanuary 1900 should be aligned with the right edge of quotThuquot unless the year is greater than 4 digits You can use the finished version of my program for testing if you d like It s located at cs1Cassescom p170caendar7fmexe Submit your program and a structure chart as a txt file to Easel httpcshardingeduease before class on the due date The main purpose of this assignment is for you to get experience using functions Use them whenever appropriate Each function should have a single purpose and be named with a verb and noun Make sure no function is greater than a printed page You will be penalized greatly for not using functions
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'