EBK C++ PROGRAMMING: PROGRAM DESIGN INC
EBK C++ PROGRAMMING: PROGRAM DESIGN INC
8th Edition
ISBN: 9781337669085
Author: Malik
Publisher: VST
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 1, Problem 17SA

Explanation of Solution

Algorithm:

...
Algorithm step C++ instruction (code)
Get the radius cin >> radius ;

Blurred answer
Students have asked these similar questions
The volume of a sphere is (4.0 / 3.0)pr3 and the surface area is 4.0pr2, where r is the radius of the sphere. Given the radius, design an algorithm that computes the volume and surface area of the sphere. Also using the C++ statements provided for Example 1-1, write the C++ statement corresponding to each statement in the algorithm. (You may assume that p = 3.141592.)
The volume of a sphere is (4.0/3.0)πr 3 and the surface area is 4.0πr 2, where r is the radius of the sphere. Given the radius, design an algorithm that computes the volume and surface area of the sphere. Also using the C++ statements provided for Example 1-1, write the C++ statement corresponding to each statement in the algorithm. (You may assume that π = 3.141592.)
Computer Science You have been given a flat cardboard of area, say, 70 square inches to make an open box by cutting a square from each corner and folding the sides (see Figure below). Your objective is to determine the dimensions, that is, the length and width, and the side of the square to be cut from the corners so that the resulting box is of maximum length. Write a C++ program that prompts the user to enter the area of the flat cardboard. The program then outputs the length and width of the cardboard and the length of the side of the square to be cut from the corner so that the resulting box is of maximum volume. Calculate your answer to three decimal places. Your program must contain a function that takes as input the length and width of the cardboard and returns the side of the square that should be cut to maximize the volume. The function also returns the maximum volume.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr