Here is the answer..
CODE1:
OUTPUT:
If you have any doubts please COMMENT...
If you understand the answer please give THUMBS UP...
can someone assist me and tell me what I'm missing. I managed to get it this...
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...
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 height of the base of a cylinder The radius of the base of a cylinder The program then outputs (in order): The volume of the cylinder. The surface area of the cylinder Format the output to two decimal...
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 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...
Which of these names can be variable names? _nase _4you 4him n4galaxy n_blrds Name_Lastname _t_h_i_s _t_h_l_s# There Is an error In this program. Describe the error and provide a solution. #include <iostream> int main(){const double pi = 3.1415; double radius = 2; std::cout << "Area is " << pi * radius * radius << std::endl; pi = 3.141592; std;:cout, "A more precise area is " << pi * radius * radius << std::endl;}
I need to implement a program that requests a x,y point and the radius of a circle. then it figures out the area and circumference using an overloaded operation. The full instructions, what I have and the errors I have are below. A point in the x-y plane is represented by its x-coordinate and y-coordinate. Design a class, pointType, that can store and process a point in the x-y plane. You should then perform operations on the point, such as...
Can someone help me with this coding question. I cannot get this to run properly. Write a program that defines the named constant PI, const double PI = 3.14159;, which stores the value of π. The program should use PI and the functions listed in Table 6-1 to accomplish the following: Output the value of √π . Prompt the user to input the value of a double variable r, which stores the radius of a sphere. The program then outputs...
Can someone please tell me why the calculation for earnings is not coming through at the end of the program? Thank you. //This program should tell us about streaming services #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { int choice, streams; double earnings; string song; string artist; string streamingService; const int Tidal = 0.01250; const int Amazon = 0.00402; const int Apple_Music = 0.00735; const int...
When running the program at the destructor an exception is being thrown. Can someone help me out? vararray.h: #ifndef VARARRAY_H_ #define VARARRAY_H_ class varArray { public: varArray(); // void constructor int arraySize() const { return size; } // returns the size of the array int check(double number); // returns index of element containg "number" or -1 if none void addNumber(double); // adds number to the array void removeNumber(double); // deletes the number from the array ...
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...