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 haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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