Write a program that will play the role of a calendar savant

Assignment Help Programming Languages
Reference no: EM132234489

Programming Assignment -

In this project, you will write a program that will play the role of a "calendar savant". The calendar in use today in the western world is called the Gregorian calendar.

a) Write a program to instruct the user to enter a date to be input as an integer month (1 to 12), an integer day of the month (1 to number-of-days-in-month), and an integer year (0 to 9999). For example, 2 1 1933 would be the 1st day of February 1933. This instruction to the user should be implemented using a function called instructions( ).

b) Your program should use a function called check( ) to determine whether the user entered a valid date. The function check( ) should return an integer value 0 if the entered date is valid, and an integer value -1 if the entered date is invalid. For example 12 44 1933 would be the 44th day of December; an invalid date. If the user inputs an invalid date, then your program should notify the user of their specific error (month outside the range of 1-12, year outside the range 0-9999, or day outside range the range 1 to number-of-days-in-month). The number-of days in each month are fixed values, except for February which has 29 days during a leap-year. Leap years are years that are divisible by 4 with no remainder, with the exception of centennial years (years divisible by 100 with no remainder) that are not divisible by 400 with no remainder. Your function check( ) will 1st check whether the entered month is between 1 and 12. If not, print-out the error, and return a -1. Then it will check the year as to whether it is between 0 and 9999, and finally the day.

If your function check( ) returns -1 to the main( ) function, your main( ) function should prompt the user to enter a valid month - day and year, starting the process over.

c) If a valid month-day-year has been entered by the user, your program will calculate the corresponding day-of -the-week. The calculation of the corresponding day-of-the-week should be done using a function called weekday( ) whose arguments are the integers month,day,year and whose return value is an integer number between 1 and 7 denoting the day of the week.

d) After the day of the week has been calculated from the date input by the user, your main program should call a 3rd function called output( ) to print the resulting day-of-the-week to the screen.

The function output( ) should use a switch statement.

e) Finally, your main program should loop to prompt the user to input another date,

f) Include comments in your program as appropriate.

To compute the day-of-the-week, use Zeller's algorithm.

Attachment:- Assignment File.rar

Reference no: EM132234489

Questions Cloud

What labor-relations laws or practices were ignored : According to your research, what was the root cause of the disaster? What labor-relations laws or practices were ignored? Could the disaster have been prevented
What are your recommendations to leadership : Following this week's reading on talent management, how have your personal views on your own individual talent changed/remained the same?
What is the total nitrogen removal efficiency : CEE 821 Plates - Demonstrate that in a Modified Ludzack-Ettinger (MLE) Process for nitrogen removal, the efficiency of total nitrogen removal is a function
How a value proposition is achieved for current employees : Define value proposition and assess how a value proposition is achieved for current and future employees leveraging a total rewards package.
Write a program that will play the role of a calendar savant : ECE 3331, Programming Assignment - In this project, you will write a program that will play the role of a "calendar savant"
Supply chain strategy supports business strategy : Write a note on How Dose Functional Strategy, Operational Strategy and Supply Chain Strategy supports Business Strategy of Any Organization
Examine the major benefits to an organization : Examine the major benefits to an organization that allocates organizational resources towards employee relations activities. Then, specify two employee relation
What you have learned from the note-taking activity : Document what you have learned from the note-taking activity. Describe how you will use note-taking skills in other ways.
What is the marginal impact of advertising on sales : EFIN 6200 Decision Models - Tulane University - State the hypothesis that tests if a non-linear relationship exists between Sales and Advertising

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a console program to display additional data items

The Software Development Company now requests you enhance the C# console program to display additional data items for all the software developers' displays.

  Template that computes and displays the absolute value

Create a program that uses this function template, passing in two arguments of type int, float, and double variable.

  Who is the mother of beatrice

CS-205: Declarative Programming (Prolog) Assignment. Translate the following questions into Prolog queries and try them out: Who is the mother of Beatrice? Who has a child (one or more)? Who is a desencendant of the Queenmother

  Write a dim statement that declares a myfriend variable name

Write a Dim statement that declares a MyFriend variable named school. Write an assignment statement that assigns the value in the txtFirst control to the strFirst member.

  Write program to open the text file-reads its contents

Write down a program which opens the text file and reads its contents into the stack of characters. Program must then pop characters from stack and save them in second text file.

  Program in c# that simulates the operation of the turtle

Write a program in C# that simulates the operation of the turtle and implements a computerized sketchpad. Write several turtle graphics programs that draw interesting shapes to use for testing your program.

  Write program to calculate diameter in centimeters of rod

Write program to calculate diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Find minimum number of edits (operations)

Given two strings str1 and str2 and below operations that can performed on str1. Find minimum number of edits (operations) required to convert 'str1′ into 'str2′.

  Write an mdi application that is a simple text editor

Write an MDI application that is a simple text editor. Allow user to open multiple documents, each in separate child form. For text editor, use one big TextBox control with its Multiline property set to true or a RichTextBox control.

  Is this an example of head or tail recursion

Referring to the code in Part 1, use the substitution model to illustrate what the result of calling (add1-iter '(1 2 3)) will be. Why is the list reversed ?

  Program to display total sales salesmen

Display total sales per (6) salesmen. Place first and last names for (6) salesmen in array. When you display your final output, print salesman's last name only.

  Application that calculates the cost of all the supplies

Write an application that calculates the cost of all the supplies added to the user's shopping list (Fig. 22.18). The application should contain two Li stBoxes. The first contains all the supplies offered and their respective prices. Users should ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd