Question: Exercise (2): Write a C++ program to calculate the volume of a cube. The program should prompt the user to enter length of a cube

Exercise (2):

Write a C++ program to calculate the volume of a cube. The program should prompt the user to enter length of a cube of float using cin statement. Hint: volume of a cube is calculated as follows:

Volume = length * length * length

The program should display the result in the following format:

Volume of a cube =

Use the pow function in your formula.

Exercise (3):

Write a C++ Program that to convert length from feets to centimeters. The program shall ask the user to enter the value in Feets (float), and converts it to centimeters according to the following formula:

C= F*30.48,

where C is the length in centimeters and F is the length in feets.

Exercise (4):

Write a program that asks the user to enter two integers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers. Result should appear as follows, using left and setw(12) functions used for output formatting:

Results

-----------------

Sum: 13

Difference: 7

Product: 30

Quotient: 3

Modulus : 1

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!