PLEASE TYPE OUT IN TEXT (please no pdf or writing)
C++ CODE
Consider the following program in which the statements are in the incorrect order.
Rearrange the statements in the following order so that the program prompts the user to input:
The program then outputs (in order):
Format the output to two decimal places.
#include <iomanip>
#include <cmath>
int main()
{}
double height;
cout << "Volume of the cylinder = "
<< PI * pow(radius, 2.0) * height << endl;
cout << "Enter the height of the cylinder: ";
cin >> radius;
cout << endl;
return 0;
double radius;
cout << "Surface area: "
<< 2 * PI * radius * height + 2 * PI * pow(radius, 2.0)
<< endl;
cout << fixed << showpoint << setprecision(2);
cout << "Enter the radius of the base of the cylinder: ";
cin >> height;
cout << endl;
#include <iostream>
const double PI = 3.14159;
using namespace std;#include <iomanip>
#include <iostream>
#include <cmath>
using namespace std;
int main(){
const double PI = 3.14159;
double height;
double radius;
cout << "Enter the height of the cylinder: ";
cin >> height;
cout << "Enter the radius of the base of the cylinder: ";
cin >> radius;
cout << fixed << showpoint << setprecision(2);
cout << "Volume of the cylinder = "<< PI * pow(radius, 2.0) * height << endl;
cout << endl;
cout << "Surface area: "<< 2 * PI * radius * height + 2 * PI * pow(radius, 2.0)<< endl;
cout << endl;
return 0;
}
PLEASE TYPE OUT IN TEXT (please no pdf or writing) C++ CODE Consider the following program...
Consider the following program in which the statements are in the incorrect order. Rearrange the statements so that the program prompts the user to input the height and the radius of the base of a cylinder and outputs the volume and surface area of the cylinder. Formant the output to two decimal places. #include <iomanip> #include <cmath> int main () {} double height; cout << ”Volume of the cylinder = “ <<PI * pow(radius, 2.0) * height << endl; cout...
The statement in the following program is in the incorrect order. Rearrange the statements so that they prompt the user to input the shape type (rectangle, circle, or cylinder) and the appropriate dimension of the shape. The program then outputs the following information about the shape: For a rectangle, it outputs the area and perimeter, for a circle, it outputs the area and circumference; and for a cylinder, it output the volume and surface area. After rearranging the statements, your...
I'm trying to write a program that can ask a user about what type of solid they have and to be able to enter values like radius and length of the shape so the program can calculate the volume of a shape and print the result. I also want to give them a repeating option to input another shape if they want to. I'm trying to use at least 7 functions that can display an output, the volumes of a...
c++ Please help! i keep getting an error message. I think my
main problem is not understanding the circle calculations function
and how both the area and the circumference is returned from the
function. I know & needs to be used, but I am unsure how to use
it.
Copy the following code and run it. You should break it into the following 3 functions getValidinput - which asks the user to enter the radius and then make sure that...
The value of π can be approximated by using the following series: The program in main.cpp uses this series to find the approximate value of π. However, the statements are in the incorrect order, and there is also a bug in this program. Rearrange the statements and remove the bug so that this program can be used to approximate π. The code that they have: #include <iostream> #include <iomanip> using namespace std; int main() { double pi = 0; long...
C++ code for CIS054 Create a program that uses a function to determine the length of a line by inputting the X,Y coordinates of the line endpoints. Show the result with a precision of four decimal places. The function prototype is to be specified as follows: double LengthOfLine (double X1, double Y1, double X2, double Y2); // returns length of line by using this code: #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main(int argc, char* argv[])...
In C++
Amanda and Tyler opened a business that specializes in shipping
liquids, such as milk, juice, and water, in cylindrical containers.
The shipping charges depend on the amount of the liquid in the
container. (For simplicity, you may assume that the container is
filled to the top.) They also provide the option to paint the
outside of the container for a reasonable amount. Write a program
that does the following:
Prompts the user to input the dimensions (in feet)...
Please help me to write a program in C++ with comments and to
keep it simple as possible.
Thank you!
Here is my program I have done before and that need
to be change:
#include <iostream>
#include <iomanip>
using namespace std;
// function prototype – returning one value
double cylvol(double, double); // Note: two data types inside
brackets
double surfarea(double, double); // Note: two data types inside
brackets
int main()
{
double r, l, V, S;
cout << setprecision(2) <<...
In this exercise, you will modify the hypotenuse program shown earlier in Figure 9-6. Follow the instructions for starting C++ and viewing the ModifyThis13.cpp file, which is contained in either the Cpp8/Chap09/ModifyThis13 Project folder or the Cpp8/Chap09 folder. Remove both calculation tasks from the main function, and assign both to a program-defined value-returning function named getHypotenuse. Test the program appropriately. //Hypotenuse.cpp - displays the length of a right //triangle's hypotenuse #include <iostream> #include <iomanip> #include <cmath> using namespace std; int...
1.- i need help with my code because it appears me "main.cpp:77:7: error: expected unqualified-id before ‘else’ else (s == 't' || s == 'T' || s == '3') ^~~~" #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double l1, l2, bl, h, d, l, p, a, h1, h2, el, ia,sb,sh,P,A,oa,pc ; double ap,pp,shp,cl,bsp,iap,blp,elp,o; char s; double const pi = 3.14159265; cout <<setfill('*')<<setw(36)<<'*'<<endl; cout <<setw(1)<<'*'<<" Rebel Alliance Computation Support "<<endl; cout <<setw(1)<<'*'<<" Star area calculator "<<endl;...