Write a program that reads in two numbers a and b. The program should calculate the following expressions and display the results to the user Sum= a+b Fun1= b+ 8 a2 + 10 Fun2= 5 va? + b2

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
100%
C++ and I need help with program 2
### Educational Website: Programming Assignment

#### Task Overview

1. **Build and Run the Program**
   - Input the radius to compute and output the volume and surface area of a sphere.

   **Example Run:**
   - For `radius = 5.2`, calculate and display the volume and surface area.

2. **Document the Output**
   - Capture a screenshot of your output and include it in your word document.
   - Copy your program into the same document.
   - Repeat these steps for `Program2`, inputting values for `a` and `b`, and output `Sum`, `Fun1`, and `Fun2`.

   **Example Run:**
   - For `a = -2.5`, `b = 7.4`, calculate and display `Sum`, `Fun1`, and `Fun2`.

3. **Submit Your Work**
   - Upload your completed document to the test portal and submit.

---

#### Program1

Develop a program that reads the radius of a sphere and calculates its volume and surface area. Ensure all results are formatted to four decimal places.

---

#### Program2

Create a program that reads two numbers, `a` and `b`. The program should compute and display the following expressions:

- **Sum**:
  \[
  \text{Sum} = a + b
  \]

- **Fun1**:
  \[
  \text{Fun1} = b^2 + 8a^2 + 10
  \]

- **Fun2**:
  \[
  \text{Fun2} = 5 \sqrt{a^2 + b^2}
  \]

---

#### Note

- Ensure you follow the instructions precisely to achieve accurate results.
- Your submission should include both the source code and the output for each program.

**Attach File:** Follow the on-screen instructions to upload your document.

**Saving:** Click "Save and Submit" after completing the task to ensure your answers are recorded.
Transcribed Image Text:### Educational Website: Programming Assignment #### Task Overview 1. **Build and Run the Program** - Input the radius to compute and output the volume and surface area of a sphere. **Example Run:** - For `radius = 5.2`, calculate and display the volume and surface area. 2. **Document the Output** - Capture a screenshot of your output and include it in your word document. - Copy your program into the same document. - Repeat these steps for `Program2`, inputting values for `a` and `b`, and output `Sum`, `Fun1`, and `Fun2`. **Example Run:** - For `a = -2.5`, `b = 7.4`, calculate and display `Sum`, `Fun1`, and `Fun2`. 3. **Submit Your Work** - Upload your completed document to the test portal and submit. --- #### Program1 Develop a program that reads the radius of a sphere and calculates its volume and surface area. Ensure all results are formatted to four decimal places. --- #### Program2 Create a program that reads two numbers, `a` and `b`. The program should compute and display the following expressions: - **Sum**: \[ \text{Sum} = a + b \] - **Fun1**: \[ \text{Fun1} = b^2 + 8a^2 + 10 \] - **Fun2**: \[ \text{Fun2} = 5 \sqrt{a^2 + b^2} \] --- #### Note - Ensure you follow the instructions precisely to achieve accurate results. - Your submission should include both the source code and the output for each program. **Attach File:** Follow the on-screen instructions to upload your document. **Saving:** Click "Save and Submit" after completing the task to ensure your answers are recorded.
Expert Solution
Step 1

The above program calculate a2 using the pow function in c++.

Square root can be find using the sqrt function in c++.

Using these functions calculate the Fun1 and Fun2.

 

steps

Step by step

Solved in 3 steps with 1 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