Write aprogram that reads the radius of a sphere, then it asks the user to enter...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write aprogram that reads the radius of a sphere, then it asks the user to enter A or a to compute the sphere area; V or v to compute the sphere volume. If the symbol entered is not valid, the program displays an error message, as shown in the sample runs below, and terminates. You need also to check for valid radius (radius > 0). Use pi from math library The volume and area of a sphere are given given by: 4 Volume = πr³ Area = 4²2 Write aprogram that reads the radius of a sphere, then it asks the user to enter A or a to compute the sphere area; V or v to compute the sphere volume. If the symbol entered is not valid, the program displays an error message, as shown in the sample runs below, and terminates. You need also to check for valid radius (radius > 0). Use pi from math library The volume and area of a sphere are given given by: 4 Volume = πr³ Area = 4²2
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
45% of a baker's total expenses are for the cost of fuel and the remainder is for the cost of material. a) in 1989, the baker's total expenses were $7000, calculate the cost of his material in 1989,...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Let z1 = 1+i and z2 = 2+ 3i. Express 1 2 in x+ yi form. 21 + %3D %3D 21 - 22 (a) + i (0)- + i (c) -i (d)--8i (e) None of these 11 (b) +i (c) - i (d) 5
-
Has the availability of shelf registrations reduced the importance of private placements? Why?
-
Graph the polynomials P(x) = 3x5 5x3 + 2x and Q(x) = 3x5 on the same screen, first using the viewing rectangle [ 2, 2] by [ 2, 2] and then changing to [ 10, 10] by [ 10,000, 10,000]. What do you...
-
Watch the Ted Talk video- https://www.youtube.com/watch?v=jOyAndLa5HU What does his story tell us about the creation of psychopathic personality disorders? What does it tell us about the interaction...
-
Consider a fully developed flow of water in a smooth pipe of diameter \(15 \mathrm{~cm}\) at a flow rate of \(0.006 \mathrm{~m}^{3} / \mathrm{s}\). The pressure drop can be calculated by the Blasius...
-
1. What characteristics did Salvatore Parasuco possess that made him successful as an entrepreneur? 2. The visibility of Parasuco jeans is higher in other countries than in Canada. Why might this be...
-
Frank Rogers owns a small firm that manufactures "Rogers Sunglasses." Frank has been approached by REI about selling a seasonal sunglass design through their stores. Frank offers REI two purchasing...
-
RZNY, LP., is a calendar-year, cash-basis limited partnership. Marc Liu, an individual, owns a 55% interest in RZNY as a general partner. During Year 1, RZNY had the following results: 1. Sales -...
-
) Let w=2022 +2023+12024, Express w in the form a + bi, where a and b are real numbers. (b) Solve in the set of complex numbers the equation 22=-i.
-
At the beginning of 2017, AB Corporation (a calendar-year corporation) owned the following assets: On February 1, 2017, AB sold its office furniture. On March 15, 2017, AB sold its computer...
-
The CPI was 51 in 1800 and 25 in 1900. What was the annual percentage rate of change during this 100-year period?
-
Suppose you and your teammates have been tasked by a Japanese global manufacturing corporation to organize the recruitment of employees for a major vehicle manufacturing and assembly plant in the...
-
On a chilly Sunday morning, Shaz Granger bought 30 dozen doughnuts for $75, prepared 10 litres of hot coffee and went to a farm auction. There, she sold all the coffee and all but six dozen of the...
-
Phonegrip Company manufactures mobile phone holders. Phonegrip currently buys a magnet for its phones for $0.90 per unit. Phonegrips president asked for cost estimates for making this product, and...
-
IssueTracking System (ITS) Description An Issue Tracking System (ITS) isa computer software application that manages and maintains lists ofissues, as needed by departments of an organization to help...
-
(a) Bright Sdn Bhd (BSB) is a tax resident manufacturing company in Johor, which involves in ceramic tiles. Currently, BSBs annual sales turnover has been forecasted to be around RM 300,000 for the...
-
Which exceptions can the next and nextInt methods of the Scanner class throw? Are they checked exceptions or unchecked exceptions?
-
What are the values of the following expressions? In each line, assume that String s = "Hello"; String t = "World"; a. s.length() + t.length() b. s.substring(1, 2) c. s.substring(s.length() / 2,...
-
How do you perform the following tasks with array lists in Java? a. Test that two array lists contain the same elements in the same order. b. Copy one array list to another. c. Fill an array list...
-
Design a fast LOT-based filter bank with at least eight sub-bands.
-
Prove the relationship in Equation (9.210). CC2=CC = 0, (9.210)
-
Show that the relations in Equations (9.256)-(9.258) are valid. E(z) = [C3+2 (I - 3)]4. (9.256)
Study smarter with the SolutionInn App