Course Solutions Uncategorized (Solved) : Fix Please Help 102 Calculate Volume Sphere Given Formula Volume Sphere Volume 4 3 Pi Rad Q38012176 . . . .

(Solved) : Fix Please Help 102 Calculate Volume Sphere Given Formula Volume Sphere Volume 4 3 Pi Rad Q38012176 . . . .

 

CAN NOT FIX THIS. PLEASE HELP

10.2 Calculate Volume of a Sphere

Given the formula for volume of a sphere as: Volume= 4/3 * PI *radius^3 Write a program that inputs a radius as a floating pointnumber (double) and outputs the volume as a floating point number.Three places of precision are needed in the output. The value of PI= 3.14.

MY CODE:

#include <iostream>
#include <iomanip>

using namespace std;

int main() {
double radius, pi = 3.14;
cin >> radius;
cout << setprecision(3) << fixed;
double volume = (4.0 / 3) * pi *radius*radius*radius;
cout << “Volume of a Sphere with Radius “<<radius<<“is = ” <<volume;
return 0;
}

Only show failing tests Download this submission 0/4 1: Compare output 1 Output differs. See highlights below Input 10.0 Your

Only

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post