/* asst01.cpp CIS 150 5/31/05 David Klick Solution to programming assignment #1 */ #include using std::cout; using std::cin; int main(void) { int heightInInches; int feet, inches; float rHeightFeet, rWidthFeet; float rHeightInches, rWidthInches; float area, circumference; // step 1 cout << "DD GGG K K\n"; cout << "D D G K K\n"; cout << "D D G GGG KK\n"; cout << "D D G G K K\n"; cout << "DD GGG K K\n\n"; // step 2 cout << "Enter your height in inches: "; cin >> heightInInches; feet = heightInInches / 12; inches = heightInInches % 12; cout << "Your height is " << feet << '\'' << inches << "\"\n\n"; // step 3 cout << "Enter height of rectangle in feet and inches (separate with a space): "; cin >> rHeightFeet >> rHeightInches; cout << "Enter width of rectangle in feet and inches (separate with a space): "; cin >> rWidthFeet >> rWidthInches; area = (rHeightFeet * 12 + rHeightInches) * (rWidthFeet * 12 + rWidthInches); circumference = 2 * (rHeightFeet * 12 + rHeightInches + rWidthFeet * 12 + rWidthInches); cout << "The area is " << area << " square inches.\n"; cout << "The circumference is " << circumference << " inches.\n"; return 0; }