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

  Design interactive program using prewritten methods

Design an interactive program that does the following, using the prewritten methods whenever they are appropriate. Prompt the user for and read a library card number, which must be between 1000 and 9999.

  Create the logic for a program which merges two files

Create the logic for a program which merges the two files into one file containing list of all students in district, maintaining student id number order.

  Determine the output displayed

Determine the output displayed when the button is clicked. Determine the output displayed when the button is clicked. Assume the five lines of the file Dates.txt contain the numbers 1492, 1776, 1812, 1929, and 1941 and the file is in the appropriat..

  Wap that prompt for and reads a double value

Write a program that prompt for and reads a double value representing a monetary amount. Then determine the fewest number of each bill and coin needed.

  Short memo to the vice-president of production

Write a short memo to the vice-president of production recommending whether the availability of any of the three resources (blending, purification, or labor) should be increased from current levels. If you recommend an increase, specify at most ho..

  Program to prompts user for integer and print prime number

Give a program which will compile in VS 2010. Write a program to prompts user for integer and then prints out all prime numbers up to that integer.

  Application to make a guessing game

The number I guess should be compared with the random generated number. If I guess correctly, the second field could display a message like "you win", else it should display "more" or "less" depending on my guess. If I fail to guess those 5 times,..

  Assembly language instructions into machine code

The assembly instructions are stored in a file. Each line of the file stores exactly oneinstruction. The name of the file should be provided to the program as a command line argument.

  Write program to establish two savings accounts

Write program which establishes two savings accounts with saver1 having account number 10002 with initial balance of $2,000, and saver2 having account 10003 with initial balance of $3,000.

  Writing static program analyses using LLVM

Dataflow Analysis. Objective - This assignment will familiarize you with writing static program analyses using LLVM

  Design program that allow player to play game of tic-tac-toe

Design a program that allows two players to play a game of tic-tac-toe. Use a two dimensional String array with three row and three columns as the game board.

  Write program uses while loop to output all odd numbers

Write a program that uses while loop to perform the following steps: Output all the odd numbers between firstnum and secondnum inclusive.

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