Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

need help to understand my lap please thank you

0 votes
asked Sep 26, 2017 by Hani AL (120 points)

n this lab you will calculate the area of three different geometrical figures: Rectangle, Circle and Ellipse.

The corresponding formulas are:

  • Area rectangle=L*l, where L corresponds to the long side and l to the short side. Values in cm.
  • Area circle=¶r², where is the constant PI=3.141592654 and r is the radius of the circle in cm.
  • Area ellipse=¶ab, where  is the constant PI=3.141592654, a is the semi-major axis length and b is the semi-minor axis length. Values in cm.

Recommended steps to follow:

  1. Setup your environment, use only the required headers.
  2. Define your constants.
  3. Program your solution:
    1. Write console messages before reading your variables.
    2. Read your variable values from the console.
    3. Define the variables you used.
    4. Do the corresponding calculations.
    5. Display your outputs in the console. Explanatory text and values.
  4. Test your solution. Feel free to use a calculator to verify your obtained values.

Constraints:

  • Do not use more than the required headers.
  • Define your input variables as float and output variables as double.
  • Format the output so that you always present the values with three decimal digits.
  • Read the inputs for the first figure and calculate/present output value, continue to second and third in the same manner.
  • Use appropriate comments in your code to illustrate your approach.
  • Format the output in a way that is easy to visualize.
  • Present the output values in m (meters). Remember that the input values are in cm (centimeters).

Have fun practicing these skills.

Submit your code and a snapshot of the console showing the results.

1 Answer

0 votes
answered Sep 27, 2017 by john

Here is source code as per your conditions, you may need to add some comments if required.

https://onlinegdb.com/ByGmTY_jW

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...