Program 7: Reserve Conference Room Due on Sunday, 11/27/2022, by 11:59pm Lab Objectives This lab was designed to reinforce programming concepts from Chapter 6 of C++ Programming: Program Design Including Data Structures, 8th Edition. In this lab you will practice: • Define a function • Understand every part of the function definition o The header of the function definition o The parameter and return value are for data exchange between functions Make a function call • Add function prototype Problem Description Modify the provided C++ program Program7_Reserve Room.cpp to use user-defined functions without changing the functioning of the given program. The figure on the following page is the provided program Program7_ReserveRoom.cpp. Programming Steps 1. Add a comment on the top of the code to include your name and the current date a. For example, //This program is created by Li Ma on 11/17/2022 2. Define three (3) functions following main function a. The code segment in the BLUE box is to display the menu for different rooms. A function displayMenu could be created for this part: i. It does not take any input-has no parameter ii. It does not output any value-has no return value b. The code segment in the RED box is to request the room choice from the user. A function makeChoice could be created for this part: i. It does not take any input-has no parameter ii. It outputs the user choice-returns an integer c. The code segment in the GREEN box is to reserve a room according to the user's choice. A function reserveRoom could be created for this part: i. It takes an input-has an integer parameter ii. It does not output any value-has no return value 3. Make function calls a. The above functions are created by moving the code segments into the body of the function definitions b. The function calls need to be added to where those code segments used to be 4. Add function prototypes a. Let main function to be on the top of all other functions b. The function prototypes need to be added before main function 5. Snapshot your compiler window after you successfully run your program, save the picture as Program7_ReserveRoom_Your Name.png. Please be aware that a. your screenshot should always include the whole compiler window, not just the result pane. b. your result pane should be big enough that all output lines will show up. 6. Download the finished program and save it as Program7_Reserve Room_YourName.cpp The following is the picture for my screenshot as an example. 9

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

Hi, can somebody help me with this assignment, please? Thanks (:

CS120-02, TSU
1 #include <iostream>
2 using namespace std;
3
4 int main()
5 - {
6
7
8
9
10
11
12
13
14
15
16
DAARNARHE
17
18
19
20-
21
22
23
24
25
26-
27
28
29
30
31
32
33
34
35
36
- -
37
38
39
40 41 2 3 44
42
43
}
int choice;
cout << "This system is for conference room reservation\n";
//Display the menu
cout << "\n*******
cout << "*\t 1. Red Private Room\t\t*\n";
cout << "*\t 2. Green Board Room\t\t*\n";
cout << "*\t 3.
cout << "*\t 4.
Blue Class Room\t\t*\n";
Yellow Banquet Room\t\t*\n";
Exit\t\t\t*\n";
cout << "*\t-1.
cout <<
*******
//Request the choice
do {
cout << "\nPlease enter your choice: ";
cin >> choice;
} while (choice!=-1 && choice!=1 && choice!=2 && choice!=3 && choice!=4);
//Reserve the room according to user's choice
switch (choice) {
case 1:
cout << "\nYou like to reserve a private meeting room. \n";
break;
}
Created by Li Ma
case 2:
cout << "\nYou like to reserve a room for board meeting.\n";
break;
case 3:
cout << "\nYou like to reserve a big classroom. \n";
break;
case 4:
cout << "\nYou like to reserve a luxury banquet room. \n";
break;
default:
cout << "\nYou have decided to exit!\n";
return 0;
CS120-02, TSU
Created by Li Ma
Problem-Solving Tips
1. In some function definition, you may need to declare some variable as needed
2. You could get the prototypes by copy & paste the header of the function definition and add a
semicolon (;) by the end
3. The switch expression (selector) is the user choice of the room
a. There are four (4) cases since there are four (4) different rooms
b. The default case is for the choice to exit
Submission
Submit both your program Program7_ReserveRoom_Your Name.cpp (80%) and your screenshot
Program7_Reserve Room_Your Name.png (20%) to Blackboard via Program7 link in Assignments
section of the course page.
Transcribed Image Text:CS120-02, TSU 1 #include <iostream> 2 using namespace std; 3 4 int main() 5 - { 6 7 8 9 10 11 12 13 14 15 16 DAARNARHE 17 18 19 20- 21 22 23 24 25 26- 27 28 29 30 31 32 33 34 35 36 - - 37 38 39 40 41 2 3 44 42 43 } int choice; cout << "This system is for conference room reservation\n"; //Display the menu cout << "\n******* cout << "*\t 1. Red Private Room\t\t*\n"; cout << "*\t 2. Green Board Room\t\t*\n"; cout << "*\t 3. cout << "*\t 4. Blue Class Room\t\t*\n"; Yellow Banquet Room\t\t*\n"; Exit\t\t\t*\n"; cout << "*\t-1. cout << ******* //Request the choice do { cout << "\nPlease enter your choice: "; cin >> choice; } while (choice!=-1 && choice!=1 && choice!=2 && choice!=3 && choice!=4); //Reserve the room according to user's choice switch (choice) { case 1: cout << "\nYou like to reserve a private meeting room. \n"; break; } Created by Li Ma case 2: cout << "\nYou like to reserve a room for board meeting.\n"; break; case 3: cout << "\nYou like to reserve a big classroom. \n"; break; case 4: cout << "\nYou like to reserve a luxury banquet room. \n"; break; default: cout << "\nYou have decided to exit!\n"; return 0; CS120-02, TSU Created by Li Ma Problem-Solving Tips 1. In some function definition, you may need to declare some variable as needed 2. You could get the prototypes by copy & paste the header of the function definition and add a semicolon (;) by the end 3. The switch expression (selector) is the user choice of the room a. There are four (4) cases since there are four (4) different rooms b. The default case is for the choice to exit Submission Submit both your program Program7_ReserveRoom_Your Name.cpp (80%) and your screenshot Program7_Reserve Room_Your Name.png (20%) to Blackboard via Program7 link in Assignments section of the course page.
CS120-02, TSU
Created by Li Ma
Program 7: Reserve Conference Room
Due on Sunday, 11/27/2022, by 11:59pm
Lab Objectives
This lab was designed to reinforce programming concepts from Chapter 6 of C++ Programming:
Program Design Including Data Structures, 8th Edition. In this lab you will practice:
●
Define a function
Understand every part of the function definition
o The header of the function definition
O The parameter and return value are for data exchange between functions
Make a function call
● Add function prototype
Problem Description
Modify the provided C++ program Program7_Reserve Room.cpp to use user-defined functions without
changing the functioning of the given program. The figure on the following page is the provided
program Program7_ReserveRoom.cpp.
Programming Steps
1. Add a comment on the top of the code to include your name and the current date
a. For example, //This program is created by Li Ma on 11/17/2022
2. Define three (3) functions following main function
a.
The code segment in the BLUE box is to display the menu for different rooms. A function
displayMenu could be created for this part:
i. It does not take any input - has no parameter
ii. It does not output any value - has no return value
b. The code segment in the RED box is to request the room choice from the user. A
function makeChoice could be created for this part:
i. It does not take any input - has no parameter
ii. It outputs the user choice - returns an integer
c. The code segment in the GREEN box is to reserve a room according to the user's choice.
A function reserveRoom could be created for this part:
i.
It takes an input - has an integer parameter
ii. It does not output any value - has no return value
CS120-02, TSU
3. Make function calls
a.
The above functions are created by moving the code segments into the body of the
function definitions
b. The function calls need to be added to where those code segments used to be
4. Add function prototypes
a. Let main function to be on the top of all other functions
b. The function prototypes need to be added before main function
5. Snapshot your compiler window after you successfully run your program, save the picture as
Program7_ReserveRoom_Your Name.png. Please be aware that
a. your screenshot should always include the whole compiler window, not just the result
pane.
b. your result pane should be big enough that all output lines will show up.
6. Download the finished program and save it as Program7_Reserve Room_Your Name.cpp
The following is the picture for my screenshot as an example.
#iger|x +
0
https://www.onleegdb.com
OnlineGOD tes
W LIM
Cred New Project
My
Clarion
Prog
Programming Cess
Loget
f+HK
601 AN OP
Have fun taking surveys
and get pod
APA-B-T of Death ---
Pivacy
02-2
25
2
M
**
Sht-clis happened to them new te with Sack
C
int main()
*This system is fur conference ruce servationin";
cout <<……………………………………………………… Sel
it << 1. Red Private Ronnit\"\n";
cout FASE 2. urean Board Hoontli";
LOVE 2. Diue Class SPOOF
& Vertrinquet
cout <-1
get the choice
You like to
while četnice 1
Please enter your chotent":
1. Rad Friv
2. Geen Drando
(chuive -12
cout << "You have decided to writy;
confirma ca
MoveBandtyA
JELLEMZuct Re
Ar your choice: 3
big clcmcomm
Created by Li Ma
...Program findabad with wate
Frs KTM Lo exii unsole-
choice
Transcribed Image Text:CS120-02, TSU Created by Li Ma Program 7: Reserve Conference Room Due on Sunday, 11/27/2022, by 11:59pm Lab Objectives This lab was designed to reinforce programming concepts from Chapter 6 of C++ Programming: Program Design Including Data Structures, 8th Edition. In this lab you will practice: ● Define a function Understand every part of the function definition o The header of the function definition O The parameter and return value are for data exchange between functions Make a function call ● Add function prototype Problem Description Modify the provided C++ program Program7_Reserve Room.cpp to use user-defined functions without changing the functioning of the given program. The figure on the following page is the provided program Program7_ReserveRoom.cpp. Programming Steps 1. Add a comment on the top of the code to include your name and the current date a. For example, //This program is created by Li Ma on 11/17/2022 2. Define three (3) functions following main function a. The code segment in the BLUE box is to display the menu for different rooms. A function displayMenu could be created for this part: i. It does not take any input - has no parameter ii. It does not output any value - has no return value b. The code segment in the RED box is to request the room choice from the user. A function makeChoice could be created for this part: i. It does not take any input - has no parameter ii. It outputs the user choice - returns an integer c. The code segment in the GREEN box is to reserve a room according to the user's choice. A function reserveRoom could be created for this part: i. It takes an input - has an integer parameter ii. It does not output any value - has no return value CS120-02, TSU 3. Make function calls a. The above functions are created by moving the code segments into the body of the function definitions b. The function calls need to be added to where those code segments used to be 4. Add function prototypes a. Let main function to be on the top of all other functions b. The function prototypes need to be added before main function 5. Snapshot your compiler window after you successfully run your program, save the picture as Program7_ReserveRoom_Your Name.png. Please be aware that a. your screenshot should always include the whole compiler window, not just the result pane. b. your result pane should be big enough that all output lines will show up. 6. Download the finished program and save it as Program7_Reserve Room_Your Name.cpp The following is the picture for my screenshot as an example. #iger|x + 0 https://www.onleegdb.com OnlineGOD tes W LIM Cred New Project My Clarion Prog Programming Cess Loget f+HK 601 AN OP Have fun taking surveys and get pod APA-B-T of Death --- Pivacy 02-2 25 2 M ** Sht-clis happened to them new te with Sack C int main() *This system is fur conference ruce servationin"; cout <<……………………………………………………… Sel it << 1. Red Private Ronnit\"\n"; cout FASE 2. urean Board Hoontli"; LOVE 2. Diue Class SPOOF & Vertrinquet cout <-1 get the choice You like to while četnice 1 Please enter your chotent": 1. Rad Friv 2. Geen Drando (chuive -12 cout << "You have decided to writy; confirma ca MoveBandtyA JELLEMZuct Re Ar your choice: 3 big clcmcomm Created by Li Ma ...Program findabad with wate Frs KTM Lo exii unsole- choice
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Events
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