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 (:

```cpp
CS120-02, TSU                                            Created by Li Ma

#include <iostream>
using namespace std;

int main()
{
    int choice;

    cout << "This system is for conference room reservation.\n";

    // Display the menu
    cout << "\n******************************************\n";
    cout << "\t1. Red Private Room\n";
    cout << "\t2. Green Board Room\n";
    cout << "\t3. Blue Class Room\n";
    cout << "\t4. Yellow Banquet Room\n";
    cout << "\t-1. Exit\n";
    cout << "\n******************************************\n";

    // 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;
        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 definitions, you may need to declare some variables 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_YourName.cpp` (80%) and your screenshot `Program7_ReserveRoom_YourName.png` (20%) to Blackboard via Program7 link in the Assignments section of the course page.
Transcribed Image Text:```cpp CS120-02, TSU Created by Li Ma #include <iostream> using namespace std; int main() { int choice; cout << "This system is for conference room reservation.\n"; // Display the menu cout << "\n******************************************\n"; cout << "\t1. Red Private Room\n"; cout << "\t2. Green Board Room\n"; cout << "\t3. Blue Class Room\n"; cout << "\t4. Yellow Banquet Room\n"; cout << "\t-1. Exit\n"; cout << "\n******************************************\n"; // 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; 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 definitions, you may need to declare some variables 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_YourName.cpp` (80%) and your screenshot `Program7_ReserveRoom_YourName.png` (20%) to Blackboard via Program7 link in the 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
    - The header of the function definition
    - 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_ReserveRoom.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
   - For example, `// This program is created by Li Ma on 11/17/2022`

2. Define three (3) functions following `main` function
   - The code segment in the **BLUE** box is to display the menu for different rooms. A function `displayMenu` could be created for this part:
     - It does not take any input – has no parameter
     - It does not output any value – has no return value
   - 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:
     - It does not take any input – has no parameter
     - It outputs the user choice – returns an integer
   - 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:
     - It takes an input – has an integer parameter
     - It does not output any value – has no return value

3. Make function calls
   - The above functions are created by moving the code segments into the body of the function definitions
   - The function calls need to be added to **where those code segments used to be**

4. Add function prototypes
   - Let `main` function to be on the top of all other
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 - The header of the function definition - 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_ReserveRoom.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 - For example, `// This program is created by Li Ma on 11/17/2022` 2. Define three (3) functions following `main` function - The code segment in the **BLUE** box is to display the menu for different rooms. A function `displayMenu` could be created for this part: - It does not take any input – has no parameter - It does not output any value – has no return value - 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: - It does not take any input – has no parameter - It outputs the user choice – returns an integer - 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: - It takes an input – has an integer parameter - It does not output any value – has no return value 3. Make function calls - The above functions are created by moving the code segments into the body of the function definitions - The function calls need to be added to **where those code segments used to be** 4. Add function prototypes - Let `main` function to be on the top of all other
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
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