Purpose: To use a defined constant. To write simple assignment statement. To declare variables. To code basic math expressions.

NOTE: Advanced students: Do NOT write or use a function.

Using assignment statements write a program which:

1.Creates identifiers (variables) called radius, area, length, width, height, volume.

2.Assigns the value of 2.5 to the variable radius.

3.Uses an expression to find the area of a circle. A = PI R^2

4.MEANINGFULLY prints the area of the circle with radius 2.5.

5.Assigns the value of 3 to length.

6.Assigns the value of 4 to width.

7.Uses an expression to find the area of a rectangle. A = lw

8.MEANINGFULLY prints the area of that rectangle.

9.Assigns the value of 5 to height.

10.Uses an expression to find the volume of a box. V = lwh

11.MEANINGFULLY prints the area of that box.

The program shall use a DEFINED constant (3.14159) for PI. (Refer to your class notes or look up the information).

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.