Question

of 3,5 in and a height of 1.45 in. 2 (General math) a. Design, wrire, compile, and run a Cs program to calculate the volume of a sphere with a radius, r, of 2 in. The volume is given by this fornula 4n h. Nlanually cheuk the values computed by your program. After verifying that your program is working coseertly, madify it to determine the volume of a cuhe with a radius of 1,67 in
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1 #include iostream» 2 using namespace std; 4 int main) 6 1 double r = 2; double volume * (22.0/7.0) * 4 (r*r*r) / 3; = cout << volume; 10 12 I Output: 33.5238

#include <iostream>

using namespace std;

int main() {

double r = 1.67;

double volume = 4 * (22.0/7.0) * (r*r*r) / 3;

cout << volume;

}

// Output: 19.517

Add a comment
Know the answer?
Add Answer to:
of 3,5 in and a height of 1.45 in. 2 (General math) a. Design, wrire, compile,...
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
  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • This is for Pycharm a python course. Can I get some help doing this and understand...

    This is for Pycharm a python course. Can I get some help doing this and understand it? ⑤ : ib tps://canvas.pasadena.edu/courses/1032754/assi a ☆ 西%N m Crowfall. Th O computing, with-c- O PHP Tutorial | SoloL ontoja. on tojav.. Write functions . def main) . def sphereVolume(r) . def sphereSurfacelr) def cylinderVolumetr. h) . def cylinderSurface(r, h) . def coneVolumefr, h) . def coneSurface(r, h) ences rations main() # call amin function at teh end In the main display, a menu...

  • Write a C++ program to compute the total volume of N cones, where N is a...

    Write a C++ program to compute the total volume of N cones, where N is a number entered by the user. Repeat the request for N until the user enters a positive number. For each cone, ask for the radius and height, compute the volume, and add that volume to the total. Each time you ask the user to enter either the height or the radius, if the user does not enter a positive number, display an error message and...

  • With this program you are going to design a math practice program for younger users. You...

    With this program you are going to design a math practice program for younger users. You will ask the user to enter two numbers. Only numbers may be entered. If the user enters a word, the program should disregard the entry and wait for an integer entry. There will not be another prompt if the user enters data other than whole numbers (integers). Here is a sample run: Your static methods should accept two integers and return an integer. Do...

  • package _solution; /** This program demonstrates how numeric types and operators behave in Java Do Task...

    package _solution; /** This program demonstrates how numeric types and operators behave in Java Do Task #1 before adding Task#2 where indicated. */ public class NumericTypesOriginal { public static void main (String [] args) { //TASK #2 Create a Scanner object here //identifier declarations final int NUMBER = 2 ; // number of scores int score1 = 100; // first test score int score2 = 95; // second test score final int BOILING_IN_F = 212; // boiling temperature double fToC;...

  • In Java Exercise #2: (Java) Design and implement a program (name it ComputeAreas) that defines four...

    In Java Exercise #2: (Java) Design and implement a program (name it ComputeAreas) that defines four methods as follows: Method squareArea (double side) returns the area of a square. Method rectangleArea (double width, double length) returns the area of a rectangle. Method circleArea (double radius) returns the area of a circle. Method triangleArea (double base, double height) returns the area of a triangle. In the main method, test all methods with different input value read from the user. Document your...

  • I'm trying to write a program that can ask a user about what type of solid...

    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...

  • iIn python please AutoSave H L04-3b Testing Lab - Protected View - Saved to this PC-...

    iIn python please AutoSave H L04-3b Testing Lab - Protected View - Saved to this PC- Search A Jharrah375@outlook.com J 7 File Home Insert Draw Design Layout Share Comments References Mailings Review View Help Areas and Volumes We'll write a program that prompts the user for a radius and then prints: a) The area and circumference of a circle with that radius b) The volume and surface area of a sphere with that radius 1. To get started, what is...

  • (a) Figure 2 shows a cuboid and a cone (not drawn to scale). Edge AB has...

    (a) Figure 2 shows a cuboid and a cone (not drawn to scale). Edge AB has length 26 cm, and the diagonal AC has length 42 cm. The radius r of the cone is 12 cm, the height h is 16 cm and the slant height l is 20 cm. D 26 cm B 1= 20 cm h=16 cm 42 cm r= 12 cm Figure 2 Give your answers to each of the following to two significant figures. (1) Find...

  • Exercise 5.5 (EASY) for beginning CS CLASS PART A Copy or cut and paste program P5_2.cpp...

    Exercise 5.5 (EASY) for beginning CS CLASS PART A Copy or cut and paste program P5_2.cpp (located below) to a new program called ex55.cpp. Make PI a constant value. Compile and run the program for the following values: r = 2 cm, h = 10 cm The correct answer should be:       The cross-section area of the cylinder is 3.89556 inch-sq       The side area of the cylinder is 19.4778 inch-sqr Did you get the correct answer? You didn't! Explain...

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