fork download
  1. //Andres Guzman CSC5 Chapter 4, P. 225, #21
  2. //
  3. /**************************************************************
  4. *
  5. * CALCULATE THE WEIGHT
  6. * ____________________________________________________________
  7. * This program will calculate the weight of an object.
  8. *
  9. * Computation is based on the formula:
  10. * Weight = mass x 9.8
  11. * ____________________________________________________________
  12. * INPUT
  13. * mass = The mass of the object
  14. * OUTPUT
  15. * weight = the total newtons of the object
  16. *
  17. **************************************************************/
  18. #include <iostream>
  19. using namespace std;
  20.  
  21. int main()
  22. {
  23. int choice;
  24. const int CIR_AREA = 1;
  25. const int REC_AREA = 2;
  26. const int TRI_AREA = 3;
  27. const int QUIT = 4;
  28. //
  29. //
  30. cout << "\t\Geometry Calculator\n\n"
  31. << "1. Calculate the Area of a Circle\n"
  32. << "2. Calculate the Area of a Rectangle\n"
  33. << "3. Calculate the Area of a Triangle\n"
  34. << "4. Quit\n"
  35. << "Enter your choice (1-4): ";
  36. cin >> choice;
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. }
  68.  
  69.  
  70.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
	Geometry Calculator

1. Calculate the Area of a Circle
2. Calculate the Area of a Rectangle
3. Calculate the Area of a Triangle
4. Quit
Enter your choice (1-4):