Question: C++ Help.. can not get these to run. It is due tomorrow. Can't get these to work. ===> Project 15: Buoyancy. Buoyancy is the ability

C++ Help.. can not get these to run. It is due tomorrow. Can't get these to work.

===> Project 15: Buoyancy. Buoyancy is the ability of an object to float. Archimedes principle states that the buoyant force is equal to the weight of the fluid that is displaced by the submerged object . The buoyant force can be computed by Fb = V y where Fb is the buoyant force, V is the volume of the submerged object , and y is the specific weight of the fluid. If Fb is greater than or equal to the weight of the object , then it will float, otherwise it will sink.

Write a program that inputs the weight (in pounds) and radius (in feet) of a sphere and outputs whether the sphere will sink or float in water. Use y = 62.4 lb/cubic feet as the specific weight of water. The volume of a sphere is computed by (4/3)(r cubed).

SAMPLE RUN: Enter the radius of the sphere, in feet:2 Enter the weight of the sphere, in pounds:2000 The sphere will float.

===>

Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates , it prints out the sum of all the even integers read and the sum of all the odd integers read(The two sums are separated by a space). Declare any variables that are needed.

===>

Given an int variable n that has already been declared and initialized to a positive value , and another int variable j that has already been declared , use a for loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j.

===>

Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002 as well all vehicles in its Guzzler line from model years 2004-2007. A bool variable named recalled has been declared . Given an int variable modelYear and a string modelName write a statement that assigns true to recalled if the values of modelYear and modelName match the recall details and assigns false otherwise.

Do not use an if statement in this exercise!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!