Write a program that computes the tax and tip on a restaurant bill for a patron with a $44.50 meal charge. The tax should be 6.75 percent of the meal cost. The tip should be 15 percent of the total after adding the tax. Display the meal cost, tax amount, tip amount, and total bill on the screen. Use the template, Program1-Template.cpp, to complete this programming assignment. Download the attached file, Program1-template.cpp, from Blackboard and rename it as Program1.cpp. Any line that starts with the characters "//" is a comment in C++ and the compiler ignores it. Remove the angle brackets "<" and ">" in any line that starts with "//" and replace it with the appropriate information.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a program that computes the tax and tip on a restaurant bill for a patron with a
$44.50 meal charge. The tax should be 6.75 percent of the meal cost. The tip should be
15 percent of the total after adding the tax. Display the meal cost, tax amount, tip amount,
and total bill on the screen. Use the template, Program1-Template.cpp, to complete this
programming assignment.

Download the attached file, Program1-template.cpp, from Blackboard and rename it as
Program1.cpp. Any line that starts with the characters "//" is a comment in C++ and the
compiler ignores it. Remove the angle brackets "<" and ">" in any line that starts with "//"
and replace it with the appropriate information.

This is a simple function written in C++ language. The function `developerInfo()` is designed to print out some information about a developer, specific to a particular course and program. Here is the breakdown of the function:

```cpp
//******************************************
void developerInfo()
{
    cout << "Name:    Reshma Kumar" << endl;
    cout << "Course:  Programming Fundamentals II" << endl;
    cout << "Program: One"
         << endl
         << endl;
}
// End of developer
//******************************************
```

**Explanation:**

1. **Line 61 to 68: Function Definition**
   - `void developerInfo()` defines the function named `developerInfo` that does not return any value (indicated by `void`).
   - The function body is enclosed within the curly braces `{}`.

2. **Line 63 to 65: Output Statements**
   - `cout` is used to output text to the console.
   - The `<<` operator is used to send the data to `cout`.
   - `"Name: Reshma Kumar"` is a string that gets printed, followed by `<< endl;`, which inserts a newline character.
   - Similarly, the next two lines print:
     - `"Course: Programming Fundamentals II"`
     - `"Program: One"`
   - The `endl` at the end of each line ensures that the printed text appears on separate lines.

3. **Line 62, 67, 68: Comment Lines**
   - Comments are included to improve code readability. They are ignored by the compiler.
   - The comment `//******************************************` is likely used to visually separate sections of the code.
   - At the end of the function, the comment `// End of developer` is added to indicate the end of this specific section.

This function, when called, will print the following information in the console:

```
Name:    Reshma Kumar
Course:  Programming Fundamentals II
Program: One
```

**Use Case:**

This function is helpful in a scenario where information about the developer needs to be displayed, perhaps as part of documentation or program metadata. It's a common practice in educational settings to embed such information within program assignments to ensure proper attribution.
Transcribed Image Text:This is a simple function written in C++ language. The function `developerInfo()` is designed to print out some information about a developer, specific to a particular course and program. Here is the breakdown of the function: ```cpp //****************************************** void developerInfo() { cout << "Name: Reshma Kumar" << endl; cout << "Course: Programming Fundamentals II" << endl; cout << "Program: One" << endl << endl; } // End of developer //****************************************** ``` **Explanation:** 1. **Line 61 to 68: Function Definition** - `void developerInfo()` defines the function named `developerInfo` that does not return any value (indicated by `void`). - The function body is enclosed within the curly braces `{}`. 2. **Line 63 to 65: Output Statements** - `cout` is used to output text to the console. - The `<<` operator is used to send the data to `cout`. - `"Name: Reshma Kumar"` is a string that gets printed, followed by `<< endl;`, which inserts a newline character. - Similarly, the next two lines print: - `"Course: Programming Fundamentals II"` - `"Program: One"` - The `endl` at the end of each line ensures that the printed text appears on separate lines. 3. **Line 62, 67, 68: Comment Lines** - Comments are included to improve code readability. They are ignored by the compiler. - The comment `//******************************************` is likely used to visually separate sections of the code. - At the end of the function, the comment `// End of developer` is added to indicate the end of this specific section. This function, when called, will print the following information in the console: ``` Name: Reshma Kumar Course: Programming Fundamentals II Program: One ``` **Use Case:** This function is helpful in a scenario where information about the developer needs to be displayed, perhaps as part of documentation or program metadata. It's a common practice in educational settings to embed such information within program assignments to ensure proper attribution.
```cpp
using namespace std;

void developerInfo(); 

/**************************************************
// Function:    main
// Description: The main function of the program
// Parameters:  None
// Returns:     Zero (0)
**************************************************/
int main()
{
    developerInfo();     // Do not delete this statement

    // Write your code here

    system("PAUSE"); 
    return 0; 
}

/**************************************************
// Function:    developerInfo
// Description: The developer's information
// Parameters:  None
// Returns:     N/A
**************************************************/
void developerInfo() 
{
    // Developer information to be added here
}
```

### Code Overview:

The provided C++ code is a simple template for a program, including both main and developerInfo functions. Below is a detailed explanation of the code structure:

- **Includes and Namespace:**
  ```cpp
  using namespace std;
  ```
  The code uses the `std` namespace to avoid prefixing standard library names with `std::`.

- **Function Declaration:**
  ```cpp
  void developerInfo();
  ```
  The `developerInfo` function is declared but not yet defined. This function will hold the developer’s information.

- **Main Function:**
  ```cpp
  /**************************************************
  // Function:    main
  // Description: The main function of the program
  // Parameters:  None
  // Returns:     Zero (0)
  **************************************************/
  int main()
  {
      developerInfo();     // Do not delete this statement

      // Write your code here

      system("PAUSE");
      return 0;
  }
  ```
  - **Description and Parameters:** A header comment block describes the `main` function, including its purpose, parameters (none in this case), and return value (zero).
  - **Functionality:** 
    - The `developerInfo` function is called.
    - A placeholder comment indicates users to write their code.
    - The `system("PAUSE")` command is used to pause the console window.
  - **Return Value:** The function returns 0 to indicate successful execution.

- **Developer Information Function:**
  ```cpp
  /**************************************************
  // Function:    developerInfo
  // Description: The developer's information
  // Parameters:  None
  // Returns:     N/A
  **************************************************/
  void developerInfo()
  {
      // Developer information
Transcribed Image Text:```cpp using namespace std; void developerInfo(); /************************************************** // Function: main // Description: The main function of the program // Parameters: None // Returns: Zero (0) **************************************************/ int main() { developerInfo(); // Do not delete this statement // Write your code here system("PAUSE"); return 0; } /************************************************** // Function: developerInfo // Description: The developer's information // Parameters: None // Returns: N/A **************************************************/ void developerInfo() { // Developer information to be added here } ``` ### Code Overview: The provided C++ code is a simple template for a program, including both main and developerInfo functions. Below is a detailed explanation of the code structure: - **Includes and Namespace:** ```cpp using namespace std; ``` The code uses the `std` namespace to avoid prefixing standard library names with `std::`. - **Function Declaration:** ```cpp void developerInfo(); ``` The `developerInfo` function is declared but not yet defined. This function will hold the developer’s information. - **Main Function:** ```cpp /************************************************** // Function: main // Description: The main function of the program // Parameters: None // Returns: Zero (0) **************************************************/ int main() { developerInfo(); // Do not delete this statement // Write your code here system("PAUSE"); return 0; } ``` - **Description and Parameters:** A header comment block describes the `main` function, including its purpose, parameters (none in this case), and return value (zero). - **Functionality:** - The `developerInfo` function is called. - A placeholder comment indicates users to write their code. - The `system("PAUSE")` command is used to pause the console window. - **Return Value:** The function returns 0 to indicate successful execution. - **Developer Information Function:** ```cpp /************************************************** // Function: developerInfo // Description: The developer's information // Parameters: None // Returns: N/A **************************************************/ void developerInfo() { // Developer information
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY