Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 > Instructions Write a program that defines the named constant PI, const double PI = 3.14159; , which stores the value of TT.

1 > Instructions Write a program that defines the named constant PI, const double PI = 3.14159; , whichg You should format your output like the following example: Surface area of the sphere: 4 * P Volume of theFunction abe (x) ceil (x) cos (x) exp (x) fabs (x) floor (x) islower (x) 1supper (x) pow (x, y) sqrt (x)

1 > Instructions Write a program that defines the named constant PI, const double PI = 3.14159; , which stores the value of TT. 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 , which stores the radius of a sphere. The program then outputs the following: o The value of 4.0r, which is the surface area of the sphere. o The value of (4.0/3.0)r, which is the volume of the sphere. g You should format your output like the following example: Surface area of the sphere: 4 * P Volume of the sphere: 4 / 3 * PI Your output must match the wording precisely to earn full credit. Format your output with setprecision (2) to ensure the proper number of decimals for testing! Function abe (x) ceil (x) cos (x) exp (x) fabs (x) floor (x) islower (x) 1supper (x) pow (x, y) sqrt (x) tolower (x) toupper (x) Header File Purpose comaths comath> cectype> Returns the absolute value of its argument: abe (-7)=7 Returns the smallest whole number that is not less than xcoil (56.34) = 57.0 Returns the cosine of angle x Cos (0.0) = 1.0 Returns e, where e-2.718: exp (1.0) - 2.71828 Returns the absolute value of its argument fabs (-5.67) 45.00 Returns true ixisa lowercase letter, otherwise it returns false; islower ('h') s true Returns trueixisa uppercase letter, otherwise it returns false; isupper ('K') is true Returns x; if x is negative, y must be a whole number pow (0.16, 0.5) -0.4 Returns the nannegative square root of x, x must be nonnegative aqrt (4.0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

include include include using namespace std int main declare constan... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual C# An Introduction to Object-Oriented Programming

Authors: Joyce Farrell

7th edition

978-1337102100

More Books

Students also viewed these Programming questions

Question

In Problems 1130, solve each equation by factoring. x 2 + 4x = 0

Answered: 1 week ago