PLEASE HELP ME IN THIS PROGRAME I HAVE MAKE A PROGRAME IN C++
I AM required to write a calculator for Geometric shapes (Circle,
Square, and Rectangle). The basic idea is that I will provide the
information regarding a geometric shape and your program will
calculate the area, circumference and perimeter.
e.g In case of circle, I will enter the radius of the circle and MY
program will display the area and circumference of circle.
Detailed Description:
1. The program should display
Enter 1 for Circle
Enter 2 for Square
Enter 3 for Rectangle
Enter your choice:
Then the program should take the input,
2. Depending upon the choice that user has entered, your program
will further display the prompt
a. If user has entered 1, then your program should prompt the user
to enter the radius of the circle, and then after taking the input
it should calculate the area and circumference of circle and display
it on the screen.
b. If the user has entered the 2, then your program should prompt
the user to enter the length of the side of Square.
After taking the input it should calculate the area and perimeter of
square and display it on the screen.
c. If the user has entered 3, your program should prompt the user to
enter the length and width of Rectangle.
After taking the input of length and width it should calculate area
and perimeter of rectangle and display it on the screen.
3. At the end your program should display your name and ID.
Hints
Area of Circle: 3.14 ª radius ª radius
Circumference of Circle: 2 ª 3.14 ª radius
Area of Square: Length of side ª Length of side
Perimeter of Square: 4 ª Length of side
Area of Rectangle: Length ª Width
Perimeter of Rectangle: 2 ª (Length + Width)
Sample Output
Enter 1 for Circle
Enter 2 for Square
Enter 3 for Rectangle
Enter your choice: 1
Enter the Radius of Circle: 2.5
The Area of Circle is: 19.64
The Circumference of Circle is: 15.71
Name:
ID:
Sample Output
Enter 1 for Circle
Enter 2 for Square
Enter 3 for Rectangle
Enter your choice: 2
Enter the Length of side A of Square: 2.5
The Area of Square is: 6.25
The Perimeter of Square is: 10
Name:
ID:
Sample Output
Enter 1 for Circle
Enter 2 for Square
Enter 3 for Rectangle
Enter your choice: 3
Enter the Length of Rectangle: 2.5
Enter the Width of Rectangle: 4
The Area of Rectangle is: 10
The Perimeter of Rectangle is: 13
Name:.
ID:
when i wrote the following program
#include <iostream.h>
main ()
{
// declare variables
float radius, diameter, circumference, area;
// prompt the user for radius of a circle
cout << "Please enter the radius of the circle " ;
cin >> radius ;
// calculate the diameter, circumference and area of the circle
// implementing formula i.e. diameter = 2 r circumference = 2 ç r
and area = ç r2
diameter = radius * 2 ;
circumference = 2 * 3.14 * radius ; // 3.14 is the value of ç (Pi)
area = 3.14 * radius * radius ;
// display the results
cout << "The diameter of the circle is : " << diameter ;
cout << "The circumference of the circle is : " << circumference ;
cout << "The area of the circle is : " << area ;
}
during compiling the following errors are received and compiling
terminated the picture appeared i am going to upload at files please
check this it is urgent i am a student and want the solution
correct the given programe or sent the new file made in dev c++.or
just send code.
IF U CAN DO THIS PLEASE PLEASE SEND ME URGENTLY I NEED IT TODAY IT
IS LAST DAY OF MY PROJECT
I SHALL BE VERY VERY THANKFUL