
Below is my C++ code. What must be the pseudocode for this?
#include <iostream>
using namespace std;
int main ()
{
int first_opt, area_opt, perimeter_opt, length, width, radius, side, height, base, a, b, c, A_Rect, A_Square, P_Rect, P_Square, P_Triangle;
float A_Circle, A_Triangle, P_Circle;
cout<<"Welcome!. Choose what you want to solve"<<"\n";
cout<<"1. AREA"<<"\n";
cout<<"2. PERIMETER"<<"\n";
cin>>first_opt;
cout<<"Choose from the following"<<"\n";
switch(first_opt)
{
case 1:
cout<<"1. Area of the Rectangle"<<"\n";
cout<<"2. Area of the Circle"<<"\n";
cout<<"3. Area of the Square"<<"\n";
cout<<"4. Area of the Triangle"<<"\n";
cin>>area_opt;
switch(area_opt)
{
case 1:
cout<<"Enter length: "<<"\n";
cin>>length;
cout<<"Enter width: "<<"\n";
cin>>width;
A_Rect = length*width;
cout<<"The area of the rectangle is: "<<A_Rect<<"\n";
case 2:
cout<<"Enter radius: "<<"\n";
cin>>radius;
A_Circle = 3.1416*radius*radius;
cout<<"The area of the circle is: "<<A_Circle<<"\n";
case 3:
cout<<"Enter side: "<<"\n";
cin>>side;
A_Square = side*side;
cout<<"The area of the square is: "<<A_Square<<"\n";
case 4:
cout<<"Enter height: "<<"\n";
cin>>height;
cout<<"Enter base: "<<"\n";
cin>>base;
A_Triangle = (height*base)/2;
cout<<"The area of the triangle is: "<<A_Triangle<<"\n";
default:
cout<<"out of options";
break;
}
break;
case 2:
cout<<"1. Perimeter of the Rectangle"<<"\n";
cout<<"2. Perimeter of the Circle"<<"\n";
cout<<"3. Perimeter of the Square"<<"\n";
cout<<"4. Perimeter of the Triangle"<<"\n";
cin>>perimeter_opt;
switch(perimeter_opt)
{
case 1:
cout<<"Enter length: "<<"\n";
cin>>length;
cout<<"Enter width: "<<"\n";
cin>>width;
P_Rect = 2*(length+width);
cout<<"The perimeter of the rectangle is: "<<P_Rect<<"\n";
case 2:
cout<<"Enter radius: "<<"\n";
cin>>radius;
P_Circle = 3.1416*radius*2;
cout<<"The perimeter of the circle is: "<<P_Circle<<"\n";
case 3:
cout<<"Enter side: "<<"\n";
cin>>side;
P_Square = 4*side;
cout<<"The perimeter of the square is: "<<P_Square<<"\n";
case 4:
cout<<"Enter the length of first side: "<<"\n";
cin>>a;
cout<<"Enter the length of second side: "<<"\n";
cin>>b;
cout<<"Enter the length of third side: "<<"\n";
cin>>c;
P_Triangle = a+b+c;
cout<<"The area of the triangle is: "<<P_Triangle<<"\n";
default:
cout<<"out of options";
break;
}
break;
default:
cout<<"out of options";
break;
}
return 0;
}

Step by stepSolved in 2 steps

- C++ this is the code i am having the following error in the png #include <iostream>#include <iomanip>#include <cctype>#include <string.h> using namespace std; // Global constantsconst int MaxWordSize = 81; // 80 characters + 1 for NULL // Given an array of characters and a shift value:// shift each character in the original text by some amount,// storing the result into the shiftedText array.// Remember: Wrap around at the end of the alphabet.// *** In the line below you must supply the function// return type and the parameter(s) ***void shiftTheText(char startingText[], int shiftVal, char shiftedText[]){// Loop through each character in the C string, startingText// When the character is an alphabetic character,// shift it by adding the shift value.// Then store the resulting character in its proper spot// in the shiftedText C string.size_t a = strlen(startingText);for(int i=0; i<a; i++){int temp =…arrow_forwardWhy do we find the event delegation paradigm and its associated components to be so useful when developing GUIs? How would you answer this question, using specific instances that illustrate your point?arrow_forwardC++ program, Please use these libraries " #include <vector> #include <ctime> #include<cstdlib> #include <algorithm> " Some number of teams are participating in a race. You are not told how many teams are participating but you do know that: • Each team has a name, which is one of the uppercase letters A – Z.• No two teams have the same name, so there are a maximum number of 26 teams. • Each team has the same number of members.• No two runners cross the finish line at the same time — i.e. there are no ties. At the end of the race we can write the results as a string of characters indicating the order in which runners crossed the finish line. For example: ZZAZAA We can see there were two teams: A and Z. Each runner is assigned a score equal to their finishing place. In the example above team Z’s runners achieved scores of 1, 2 and 4. Team A’s runners scores were 3, 5, and 6 respectively. The team’s score is the sum of the members score divided by…arrow_forward
- This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees…arrow_forwardc++ programming one of the image is what the output of the code is supposed to be. please use these if possible: #include <iostream> using namespace std; other stuff such as #include <conio.h> doesn't work on my compiler. Please help me with this program. Thanks!arrow_forwardWhat is the pseudocode for this? Below is the C++ #include <iostream> using namespace std; int main () { int first_opt, area_opt, perimeter_opt, length, width, radius, side, height, base, a, b, c, A_Rect, A_Square, P_Rect, P_Square, P_Triangle; float A_Circle, A_Triangle, P_Circle; cout<<"Welcome!. Choose what you want to solve"<<"\n"; cout<<"1. AREA"<<"\n"; cout<<"2. PERIMETER"<<"\n"; cin>>first_opt; cout<<"Choose from the following"<<"\n"; switch(first_opt) { case 1: cout<<"1. Area of the Rectangle"<<"\n"; cout<<"2. Area of the Circle"<<"\n"; cout<<"3. Area of the Square"<<"\n"; cout<<"4. Area of the Triangle"<<"\n"; cin>>area_opt; switch(area_opt) { case 1: cout<<"Enter length: "<<"\n"; cin>>length; cout<<"Enter width: "<<"\n"; cin>>width; A_Rect = length*width; cout<<"The area of the…arrow_forward
- This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees…arrow_forwardGiven the following set of code, select all C++ expressions: 4₁ #include #include #include #include "grocery_list_lib.h" // Returns an array of pair objects of item and amount std::array, 5> create_grocery_list (){ std::array, 5 grocery_list; std::string item; std::string item_amount; F3 double amount; for(int i = 0; i > amount grocery_list[i].second = amount; } return grocery_list; } grocery_list[i].first std::string item; item_amount return grocery_list; "Enter item: $ 4 4) R Q Search DII % 5 T F5 6 LO F6 Y F7 & 7 U BO PrtScn F8 8 Home F9 9 End F10 Po 0arrow_forwardC++ shapes.h: #include <iostream>#include <cmath>struct Point2d{double x;double y;void print(){// example: (2.5,3.64)std::cout << "(" << x << "," << y << ")" << std::endl;}double length() const{return std::sqrt(x * x + y * y);}// const Point2D & ==> function can't modify 'other'// the second const ==> function can't modify x, yPoint2d add(const Point2d &other) const{Point2d result;result.x = x + other.x;result.y = y + other.y;return result;}};// example of an interfacestruct Shape{virtual bool contains(Point2d p) = 0;};struct Circle : Shape{Point2d center;double radius;bool contains(Point2d p){Point2d diff;diff.x = p.x - center.x;diff.y = p.y - center.y;double distToCenter = diff.length();return distToCenter <= radius;}};// TODO: replace this with your Rectangle implementationstruct Rectangle : Shape{// TODO: which member variables to model a rectangle?bool contains(Point2d p){return false; // TODO }};//…arrow_forward
- C++, create flowchart for this code: #include <iostream> using namespace std; const int ROWS = 3;const int COLS = 3;const int MIN = 1;const int MAX = 9; bool isMagicSquare(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);bool checkRange(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max);bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);bool checkRowSum(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);bool checkColSum(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);bool checkDiagSum(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);void fillArray(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size);void showArray(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size); int main(){int arrayRow1[ROWS], arrayRow2[ROWS], arrayRow3[ROWS];char ch;do{fillArray(arrayRow1, arrayRow2, arrayRow3, ROWS);showArray(arrayRow1, arrayRow2, arrayRow3,…arrow_forward#include<iostream> #include <cmath> using namespace std; int main() { float sp_Radius, sp_sa, sp_Volume; cout << "\nPlease Enter the radius of a Sphere = "; cin >> sp_Radius; sp_sa = 4 * M_PI * sp_Radius * sp_Radius; sp_Volume = (4.0/3) * M_PI * sp_Radius * sp_Radius * sp_Radius; cout << "\nThe Surface Area of a Sphere = " << sp_sa; cout << "\nThe Volume of a Sphere = " << sp_Volume; return 0; } C++ use this code and separate the program into three files. The main program containing the main function should be named main.cpp. The function definition file containing a function for the volume calculation and a function for the surface area calculation should be named SphereCalc.cpp. The function declaration file containing function declarations for the functions should be named SphereCalc.h. Make sure you include a Header Guard. Read the Radius from the Keyboard. If a negative number is provided, set the calculated value to zero.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





