1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jek_recluse [69]
3 years ago
12

Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program

that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.
Computers and Technology
1 answer:
insens350 [35]3 years ago
4 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

   double side, height;

   

   cout<<"Enter the length of one of the sides of the base: ";

   cin>>side;

   cout<<"Enter the height: ";

   cin>>height;

   

   double area = side * side;

   double volume = area * height / 3;

   

   cout<<"The area of the base of the pyramid is: "<<area<<endl;

   cout<<"The height of the pyramid is: "<<height<<endl;

   cout<<"The volume of the pyramid is: "<<fixed<<setprecision(2)<<volume<<endl;

   return 0;

}

<u>Pseudocode:</u>

Declare side, height

Get side

Get height

Set area = side * side

Set volume = area * height / 3

Print area

Print height

Print volume

Explanation:

Include <iomanip> to have two decimal places

Declare the side and height

Ask the user to enter side and height

Calculate the base area, multiply side by side

Calculate the volume using the given formula

Print area, height and volume (use <em>fixed</em> and <em>setprecision(2)</em> to have two decimal places)

You might be interested in
What is Gamekit Loa3's all questsions
Stells [14]
Video games and currency premium playing
4 0
4 years ago
Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on the street, h
klio [65]

Answer:

what the answer chaoices

Explanation:

brainlest me please

3 0
3 years ago
Select all the correct answers.
oksian1 [2.3K]

Answer:

It's probably "facilitate discussions"

Hope this helps you!

Bye!

4 0
3 years ago
Read 2 more answers
COMPUTER SCIENCE:PIXELS
DIA [1.3K]
The number of bits used to represent each pixel determines how many colors or shades of grey can be displayed. For example, in 8-bit color mode the color monitor uses 8 bits for each pixel, making it possible to display 2 to the 8th power (256) colors/shades of grey.
3 0
3 years ago
These are pictorial images displayed on a computer screen​
Mrrafil [7]

Answerthats nice

(: -With Star

Explanation:

3 0
2 years ago
Other questions:
  • Frances is rearranging her furniture. (1) Also, she is moving the heavy oak bookcase to the back bedroom. (2) She has decided to
    7·2 answers
  • After class, Anita and Bev make plans to study for their psychology exam together but cannot decide on a time or location. In ad
    7·1 answer
  • Is cheque money? give reason​
    9·1 answer
  • Write down the pseudo code of a program that calculates the Body Mass Index (BMI) of
    9·1 answer
  • 2. Why don't all buses on a motherboard operate at the same speed?​
    6·1 answer
  • How did Avery and Garth most likely create their
    13·1 answer
  • What is a fundamental difference between the SAP platform and the AirBnB platform?
    10·1 answer
  • What is output? Select all that apply. c = 0 while (c &lt; 5): c = c + 1 print(c) 6 5 2 4 3 0 1
    9·1 answer
  • How do you think Beyoncé choreography has/will influence the future of dance?
    9·2 answers
  • each data mining technique has its advantages and limitations. which data mining technique mimics the neural structure of the br
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!