Program that will ask for a month

Assignment Help C/C++ Programming
Reference no: EM13161022

Write a program that will ask for a month (1-12) and a year (yyyy). the program should then produce a calendar showing the month name and year and have all of the days displayed under it.

Here are the specifications:

  • The program must be programmed in standard C++

  • The month must be an integer from 1 to 12. If the user enters anything outside of that range, the program must display an error message and ask the user to re-enter the month until the user gets it right.

  • The year be an integer from 1582 to 2038. Anything other than that should produce an error message and ask the user to re-enter the year until the user gets it right.

  • There must be a left margin of 3 spaces and a top margin of one blank line.

  • The numbers in the calendar must be right-justified. Hint: setw.

  • Your calendar must take into account leap years. Leap years affect the month of February. On leap years, February must have 29 days. On non-leap years, February must have 28 days. See my notes on leap years for more information.

    prototypes:

    int getInteger( string prompt, int min, int max )

    void displayCalendar( int month, int year )

    This function should call the getDayOfWeek and getLastDay functions to build the calendar. Use getDayOfWeek to get the day of the week for the first day of the month then use getLastDay to get the total number of days in a month.

 

Reference no: EM13161022

Questions Cloud

Compare and contrast the shape of most animal cells : (A) Compare and contrast the shape of most animal cells with respect to most plant cells in terms of osmotic potential? (B) What is it that osmosis requires that sets it apart from simple diffusion?
What is the missing subnet id : What is the missing subnet ID for SUB3 assuming they are assigning the subnets in subnet ID  order? What is the range of IP addresses that may be used for hosts on SUB3?
Write a command to do an alphabetical sort on the third fiel : Write the command to run the file called 'process' assuming it is in your current directory, has execute permission, but that your current directory is not in the standard path command search list:
Hexadeciaml numerals are integers written : Hexadeciaml numerals are integers written in base 16. The digits used are '0' through '9' plus 'a' for the "digit 10", 'b' for the "digit 11", 'c' for the "digit 12", 'd' for the "digit 13", 'e' for the "digit 14", and 'f' for the "digit 15". For exa..
Program that will ask for a month : Write a program that will ask for a month (1-12) and a year (yyyy). the program should then produce a calendar showing the month name and year and have all of the days displayed under it.
Function whose job is to output some sequence : Write a function whose job is to output some sequence of "interesting" #'s. The numbers should be separated from one another somehow so they don't all run together. This function may need to call another function, where the second function determines..
What is the probability : Suppose that the probability than an incoming email is a spam is p(S), that the probability that the word "w" occurs in the subject line of the spam is p(w), and that q(w) is the probability that the word "w" occurs in the subject line of an email th..
Function whose job is to input : Write a function whose job is to input #'s, non-# to quit, recover from the input failure by calling recover(), and tell main some statistics about the numbers read. A. unsigned readA();
The user enter the total rainfall for each of 12 months : Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display:the total rainfall for the year,the average monthly rainfall,and the months w..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Prepare a program for a retail-mart company

Prepare a program for a company Retail-Mart.

  Program to declare array alpha of components of type int

Write C++ statements to do the following: Declare an array alpha of 15 components of the type int. Output the value of the tenth component of the array alpha.

  Write program to calculate net pay for factory worker

Write and run a program in C++ that calculates the net pay for a factory worker. The program prompts the user for skill level and hours worked, as well as appropriate insurance and retirement options for the employee's skill.

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  The use of decision logic

The use of decision logic is one of the major concepts of computer programming.

  A hierarchical jpeg encode decoder for greyscale images

This project is to develop a program that implements a hierarchical JPEG encoder/decoder for greyscale images.

  Write a program that inputs a dollar amount to be printed

Write a program that inputs a dollar amount to be printed on a check and then prints the amount in check-protected format with leading asterisks if necessary

  C assignment of curl library

C Assignment Curl library must be used To be done on linux, it should be compiled using the following command: gcc -Wall -ansi -pedantic NameOfFile.c -lncurses Please make sure it is commented with clarification Variable names in camel case

  Write a program that takes a positive integer

Write a program that takes a positive integer from the user and prints the rightmost digit of that integer. This is a sample output: Enter an integer: 1247

  Write program function prompt user for number of elements

Write a C++ program main function which will prompt the user for the number of elements called N desired for an array which has the capacity to store 50 elements.

  Write a count occurrences() function that accepts a string

Write a CountOccurrences() function that accepts a string to be searched and a sub-string to be found. The function should return the # of times the sub-string is found. Write a tester file that declares a secret sentence as a constant.

  Write program in c to calculate diameter-compression load

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

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