Guest User

Untitled

a guest
Nov 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int type_of_room, area_of_room, width_of_room_1, width_of_room_2, length_of_room_2, radius_of_room;
  7. cout << "Haverly's Room Calculator: \n***********************************\n";
  8. cout << "1. Square Room \n2. Rectangular Room \n3. Round Room \n4. Quit \n";
  9. cout << "\nType of Room: ";
  10. cin >> type_of_room;
  11. //this is going to be fun (sarcasm)
  12. switch (type_of_room)
  13. {
  14. case 1:
  15. //square room
  16. cout << "Please enter the width of the room. ";
  17. cin >> width_of_room_1;
  18. area_of_room = width_of_room_1 * width_of_room_1;
  19. cout << "\nSquare Room \nArea of Room = " << area_of_room << " sq/ft.\n" << endl;
  20. break;
  21. case 2:
  22. //rectangular room
  23. cout << "Please enter the width and length. ";
  24. cin >> width_of_room_2 >> length_of_room_2;
  25. area_of_room = width_of_room_2 * length_of_room_2;
  26. cout << "\nRectangle Room \nArea of Room = " << area_of_room << " sq/ft.\n" << endl;
  27. break;
  28. case 3:
  29. //round room
  30. cout << "Please enter the radius. ";
  31. cin >> radius_of_room;
  32. area_of_room = 3.14 * (radius_of_room * radius_of_room);
  33. cout << "\nRound Room \nArea of Room = " << area_of_room << " sq/ft.\n";
  34. break;
  35. case 4:
  36. //quit the program
  37. cout << "\nNow exiting the program.\n";
  38. exit(0);
  39. break;
  40. default: cout << "Thank you for using Haverly's Room Calculator. Exiting program.";
  41.  
  42. }
  43.  
  44. }
Add Comment
Please, Sign In to add comment