Please provide a structure chart and pseudocode using the c++ code below thanks

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

Please provide a structure chart and pseudocode using the c++ code below thanks

E#include <iostream>
#include <cctype>
1
2
3
#include <cmath>
using namespace std;
void display_menu();
void square();
void squareroot();
I void power();
4
5
6
7
8
9
Qint main() {
char option;
10
11
12
do {
display_menu();|
13
14
cout <« "\nEnter option >> ";
cin >> option;
15
16
17
18
switch (option) {
19
case 's': square ();
20
break;
case 'Q': squareroot ();
break;
21
22
case 'P': power ();
break;
case 'E': cout << "Program ends now" << endl;
break;
default: cout « "Please enter only s, Q, P, E." << endl;
}
} while (option != 'E');
23
24
25
26
27
28
29
30
31
return 0;
32
33
Transcribed Image Text:E#include <iostream> #include <cctype> 1 2 3 #include <cmath> using namespace std; void display_menu(); void square(); void squareroot(); I void power(); 4 5 6 7 8 9 Qint main() { char option; 10 11 12 do { display_menu();| 13 14 cout <« "\nEnter option >> "; cin >> option; 15 16 17 18 switch (option) { 19 case 's': square (); 20 break; case 'Q': squareroot (); break; 21 22 case 'P': power (); break; case 'E': cout << "Program ends now" << endl; break; default: cout « "Please enter only s, Q, P, E." << endl; } } while (option != 'E'); 23 24 25 26 27 28 29 30 31 return 0; 32 33
Evoid display_menu() {
cout <« "\NSELECT OPTION TO CALCULATE:\n";
34
35
cout << "====
cout <« "[S] square of a number\n";
cout <« "[Q] squareroot of a number\n";
cout <« "[P] x power of Y\n";
cout <« "Press [E] to exit the program\n";
36
=======\n";
37
38
39
40
41
42
43
Evoid square() {
44
double x, result;
45
cout <« "Please enter a number:
cin >> x;
result - x * x;
46
47
48
cout <« "The answer is " <« result « "." <« endl;
49
50
Evoid squareroot() {
double x, result;
51
52
cout << "Please enter a number: ";
cin >> x;
53
54
55
result =
sqrt(x);
56
cout << "The answer is "
<« result << "." << endl;
57
58
Evoid power () {
59
double x, y, result;
cout <« "Please enter two numbers: ";
cin >> x >> y;
result =
60
61
62
63
pow(x, у);
64
cout <« "The answer is " « result <« "." << endl;
65
Transcribed Image Text:Evoid display_menu() { cout <« "\NSELECT OPTION TO CALCULATE:\n"; 34 35 cout << "==== cout <« "[S] square of a number\n"; cout <« "[Q] squareroot of a number\n"; cout <« "[P] x power of Y\n"; cout <« "Press [E] to exit the program\n"; 36 =======\n"; 37 38 39 40 41 42 43 Evoid square() { 44 double x, result; 45 cout <« "Please enter a number: cin >> x; result - x * x; 46 47 48 cout <« "The answer is " <« result « "." <« endl; 49 50 Evoid squareroot() { double x, result; 51 52 cout << "Please enter a number: "; cin >> x; 53 54 55 result = sqrt(x); 56 cout << "The answer is " <« result << "." << endl; 57 58 Evoid power () { 59 double x, y, result; cout <« "Please enter two numbers: "; cin >> x >> y; result = 60 61 62 63 pow(x, у); 64 cout <« "The answer is " « result <« "." << endl; 65
Expert Solution
steps

Step by step

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