Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Group members (group 4)

1.
2.
3.
4.
5.

Hairuddin Bin munip


Muhammad Bahjatuddin Bin Mohd Idris
Afendi Bin Zahari
Ting Su Lee
Nur Ariff Bin Zainudin

CF140111
CF140117
CF140222
CF140093
CF140287

Volume and Area


#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
float radius, volume, area, height;
cout << "Welcome to the object surface area and volume calculator. \n" ;
cout << "Program written by Group 4 BFC 20802 COMPUTER PROGRAMMING
C++" << endl;
cout << "***************************************************************" <<
endl;
cout << "Calculated the Volume and Surface Area for the Sphere. \n" ;
cout << "Enter the radius: ";
cin >> radius ;
volume = (4.0/3) *3.142*radius*radius*radius ;
area = 4*3.142*radius*radius ;
cout << "\nThe volume of a Spehere with radius "
<< radius << " is " << volume << endl ;
cout << "\nThe area of a Spehere with radius "
<< radius << " is " << area << endl ;
cout << "-------------------------------------------------------------\n" ;
cout << "Calculated the Volume and Surface Area for the Hemisphere. \n" ;
cout << "Enter the radius : " ;
cin >> radius;
volume = (2.0/3) *3.142*radius*radius*radius;
area = 3*3.142*radius*radius ;
cout << "\nThe volume of a Hemispehere with radius "
<< radius << " is \n" << volume << endl ;
cout << "\nThe surface area of a Hemisphere with radius "
<< radius << " is " << area << endl ;
cout << "-------------------------------------------------------------\n" ;

cout << "Calculated the Volume and Surface Area for the Cone. \n" ;
cout << "Enter the radius : " ;
cin >> radius;
cout << "Enter the height : " ;
cin >> height ;
volume = (1.0/3) *3.14*radius*radius*height ;
area = 3.14*radius*radius + 3.14*radius*height ;
cout << "\nThe volume of a Cone with radius and height "
<< " is " << volume << endl ;
cout << "\nThe surface area of a cone with radius and height "
<< " is " << area << endl ;
cout << "-------------------------------------------------------------\n" ;

cout << "Please press any key to exit... " << endl;
getch();
}

You might also like