Professional Documents
Culture Documents
//perimeterCircleV1.cpp //Michael Gebhardt //program calculates perimeter of a circle //perimeter = PI * diameter //diameter = 2 * radius #include <iostream> using namespace std; int main() { //declaration const double PI = 3.141592; double radius, diamter, perimeter;
//assignment cout << "Enter radius of circle: "; cin >> radius;
//output cout << "Perimeter for circle with input value is " << perimeter << endl;
system("PAUSE"); return 0; }
//rectangleVolumeV1.cpp //Michael Gebhardt //program calculates area of a rectangle //volume = length * width * height #include <iostream> using namespace std; int main() { //declaration double length, width, height, volume;
//assignment cout << "Enter length: "; cin >> length; cout << "Enter width: "; cin >> width; cout << "Enter height: "; cin >> height;
//output cout << "Volume for a rectangular prism with input values is " << volume << + " cubic units" << endl; system("PAUSE"); return 0; }