using void functions 1. Complete the program shown below. Note: do not omit the comments a) You will write a void function to get a positive integer between 1 and 12 inclusive. The twelve numbers represent the months of the year. The user will be asked to enter an integer between 1 and 12 inclusive. If the number entered by the user is not within range, an appropriate error message will be displayed, and the user will be asked to try again until a valid number is entered. b) You will write a void function to print the month number and the month name with an appropriate message. Consider a good layout when displaying the output. c) You will also complete the function main by making a call to the function GetMonthNumber with an appropriate argument and by making a call to the function DisplayMonth with an appropriate argument d) Add a loop to allow the program to repeat, allowing the user to continue. Consider proper indentation and alignment of the statements. e) Output your name as well before the program ends. f) Test the functions using different test data. Show several examples to show that the program performs validation check as well. Write the documentation and include the screenshots.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

using void functions 1. Complete the program shown below. Note: do not omit the comments a) You will write a void function to get a positive integer between 1 and 12 inclusive. The twelve numbers represent the months of the year. The user will be asked to enter an integer between 1 and 12 inclusive. If the number entered by the user is not within range, an appropriate error message will be displayed, and the user will be asked to try again until a valid number is entered. b) You will write a void function to print the month number and the month name with an appropriate message. Consider a good layout when displaying the output. c) You will also complete the function main by making a call to the function GetMonthNumber with an appropriate argument and by making a call to the function DisplayMonth with an appropriate argument d) Add a loop to allow the program to repeat, allowing the user to continue. Consider proper indentation and alignment of the statements. e) Output your name as well before the program ends. f) Test the functions using different test data. Show several examples to show that the program performs validation check as well. Write the documentation and include the screenshots. 

 

//prompt user to enter number and read the number
cout <« "Enter a number between 1 and 12 inclusive: ":
cin >>
//while number entered is not between
//between 1 and 12
// inclusive
while
{
cout « number « " is not between 1 and 12 inclusive. \n";
cout « "Try again. Enter a number between 1 and 12: ";
// read the next number
}
//*******************
// Definition of function DisplayMonth.
// The parameter number holds an integer between 1 and 12 inclusive
// representing a month number.
// The function displays the month number and the corresponding month name.
**********
//***********
****************************
**************
void DisplayMonth (_
Transcribed Image Text://prompt user to enter number and read the number cout <« "Enter a number between 1 and 12 inclusive: ": cin >> //while number entered is not between //between 1 and 12 // inclusive while { cout « number « " is not between 1 and 12 inclusive. \n"; cout « "Try again. Enter a number between 1 and 12: "; // read the next number } //******************* // Definition of function DisplayMonth. // The parameter number holds an integer between 1 and 12 inclusive // representing a month number. // The function displays the month number and the corresponding month name. ********** //*********** **************************** ************** void DisplayMonth (_
// Purpose:
To get a month number betveen 1 and 12 inclusive and
print the month number and the corresponding month name.
II This part to be completed
//---
//tor using cin and cout
include <iostream>
using namespace std:
// Function Prototypes
void GetMonthMamber (ints):
void Displaytonth (int) :
int main()
int monthilum:
//a number representing a month
GetMonthlunber L
): 1/get a month number
//call function to output the month number
// and month name
systen (pause":
return 0:
// Definition of function GetMonthliumber.
// The parameter number is a reference parameter to an int.
I/ The funetion asks the user to enter an integer betveen 1 and 12 inclusive.
// It the number entered is not within range, an error message will be
// displayed, and the user will be asked to try again until a valid nunber is
// entered.
.......
void GetMonthlumber(
//nunber representing month nunber
//prompt uaer to enter number and read the number
cout « "Enter a number betveen 1 and 12 inclusive: ":
cin >>
I/hile nunber entered 1s not betveen
) //betveen 1 and 12
// inclusive
while
cout « nunber <«- is not between 1 and 12 inclusive. \n":
cout ce Try again. Enter a nunber betveen 1 and 12: ":
// read the next number
Transcribed Image Text:// Purpose: To get a month number betveen 1 and 12 inclusive and print the month number and the corresponding month name. II This part to be completed //--- //tor using cin and cout include <iostream> using namespace std: // Function Prototypes void GetMonthMamber (ints): void Displaytonth (int) : int main() int monthilum: //a number representing a month GetMonthlunber L ): 1/get a month number //call function to output the month number // and month name systen (pause": return 0: // Definition of function GetMonthliumber. // The parameter number is a reference parameter to an int. I/ The funetion asks the user to enter an integer betveen 1 and 12 inclusive. // It the number entered is not within range, an error message will be // displayed, and the user will be asked to try again until a valid nunber is // entered. ....... void GetMonthlumber( //nunber representing month nunber //prompt uaer to enter number and read the number cout « "Enter a number betveen 1 and 12 inclusive: ": cin >> I/hile nunber entered 1s not betveen ) //betveen 1 and 12 // inclusive while cout « nunber <«- is not between 1 and 12 inclusive. \n": cout ce Try again. Enter a nunber betveen 1 and 12: ": // read the next number
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education