Question
This is a C++ statement, when it comes to Algebra, this is very difficult for me to solve this, please help me solve this problem with step-by step solutions

Question 27 10 pts (SHORT ANSWER) Write C++ statements to do the following (number your answers): 1. Declare a constant PI an
0 0
Add a comment Improve this question Transcribed image text
Answer #1

code:

==============================

#include <iostream>
#include <iomanip>
using namespace std;

//1.declare a constant pi
# define PI 3.1415
int main() {
//2.declare a varaible volume of type double
double volume;
int r=2,h=5;
//3.calculate volume of cone
volume = PI*(r*r)*(h/3);
//4.Display the computed volume
cout<<"Volume : "<<fixed<<setprecision(2)<<volume;
}   

1 2 3 4 5 6 #include <iostream> #include <iomanip> using namespace std;|| 1/1.declare a constant pi # define PI 3.1415 7- int

please upvote and comment for doubts

Add a comment
Know the answer?
Add Answer to:
This is a C++ statement, when it comes to Algebra, this is very difficult for me...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • python programming Canvas → XCO Question 28 10 pts (SHORT ANSWER) Write Python statements to do...

    python programming Canvas → XCO Question 28 10 pts (SHORT ANSWER) Write Python statements to do the following (number your answers); 1. Create a constant PI and assign it 3.1415 2. Calculate the volume of the cone and store it in the variable volume . Given the formula to compute the volume of a cone is: II-> (5) • Assume: the variables r and h are already assigned with values 3. Display the computed volume on the console as follows...

  • using Java The formula to compute the volume of a sphere is: volume = ( 4...

    using Java The formula to compute the volume of a sphere is: volume = ( 4 3 ) π r 3 where r is the radius of the sphere and π is 3.14159. Assume a variable radius has already been declared (type double) and initialized with the value of the radius of a sphere. Write java statements to do the following: Declare a constant PI and initialize it to 3.14159 Declare a variable volume of type double Calculate the volume...

  • This exercise is also from C++ How do I even figure this out? please help me...

    This exercise is also from C++ How do I even figure this out? please help me solve so I can get the answer correctly! Question 28 10 pts (SHORT ANSWER) Define a function named findEvenOrOdd that has 1 int parameter: num. When the function is called, it should use an if/else statement -OR- conditional expression to determine whether the variable num is an even or odd number and display appropriate message as follows: • If the value in num is...

  • Use C++ For this week’s lab you will write a program to read a data file...

    Use C++ For this week’s lab you will write a program to read a data file containing numerical values, one per line. The program should compute average of the numbers and also find the smallest and the largest value in the file. You may assume that the data file will have EXACTLY 100 integer values in it. Process all the values out of the data file. Show the average, smallest, largest, and the name of the data file in the...

  • Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin...

    Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin at the University of Washington, Seattle, who originally wrote this assignment (for their CSE 142, in Java) This program focuses on classes and objects. Turn in two files named Birthday.cs and Date.cs. You will also need the support file Date.dll; it is contained in the starter project for this assignment. The assignment has two parts: a client program that uses Date objects, and a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT