Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code using void functions Complete the program shown below. Note : do not omit the comments You will write a void function to get

C++ code

using void functions

Complete the program shown below. Note: do not omit the comments

  1. 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.
  2. 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.
  3. 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
  4. Add a loop to allow the program to repeat, allowing the user to continue. Consider proper indentation and alignment of the statements.image text in transcribed
  5. Output your name as well before the program ends.
// Purpose: To get a month number between 1 and 12 inclusive and print the month number and the corresponding month name. // This part to be completed #include 1/for using cin and cout using namespace std; // Function Prototypes void Get Monthusber(ints); void DisplayMonth (int); int main() int monthNum: Get Monthlumber 1/a number representing a month ); //get a month number //call function to output the month number // and month name system("pause"; return 0; 3 // Definition of function Get Month Number. // The parameter number is a reference parameter to an int. // The function asks the user to enter an integer between 1 and 12 inclusive. // If 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 number is 11 entered. void GetMonthlumber /umber representing month number 1/prompt user to enter number and read the number cout > while //while number entered is not between //between 1 and 12 // inclusive cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions