fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int creditHours, studyHours, actuallyHours;
  8. //Yonni Bueno-Jaimes
  9. // asking user to input credit hours for the current semester
  10. cout << "How many credit hours are you taking this semester?" << endl;
  11. cin >> creditHours;
  12.  
  13. //the user's input is times by 3
  14. studyHours = 3 * creditHours;
  15. cout << "You should be studing " << studyHours << " hours." << endl;
  16.  
  17. //user is asked how much time they actually study
  18. cout << "How many hours do you actually spend studying?" << endl;
  19. cin >> actuallyHours;
  20.  
  21. // the differece between the actually hours and the study hours is done
  22. studyHours = studyHours - actuallyHours;
  23. cout << "You are only studing "<< studyHours << " hours from what you should actually be spending." << endl;
  24.  
  25. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  26.  
  27. //The 2014 FIFA World Cup was played in Rio de Janeiro, Brazil.
  28. double stadiumWigthFt;
  29. double stadiumLenthFt;
  30. double ballCircumference;
  31. int numPlayer;
  32. double playingTime;
  33.  
  34. cout << "The Estádio Jornalista Mário Filho is 105 m × 68 m." << endl;
  35. //convert meter to ft
  36. stadiumWigthFt = (105 * 3.28);
  37. stadiumLenthFt = (68 * 3.28);
  38. cout << "The Estádio Jornalista Mário Filho is "<< stadiumWigthFt << " ft × " << stadiumLenthFt << " ft." << endl;
  39.  
  40. //calculation of the ball circumference in cm
  41. ballCircumference= 22 * M_PI;
  42. cout<<"The ball circumference is "<< ballCircumference << " in cm." << endl;
  43.  
  44. //time each player will play
  45. cout << "How many players are going to play?" << endl;
  46. cin >> numPlayer;
  47. cout << numPlayer << endl;
  48. playingTime = 90.0 / numPlayer;
  49. cout << "Each player will get to play for "<< playingTime << " minutes.";
  50.  
  51.  
  52. return 0;
  53. }
Success #stdin #stdout 0s 4176KB
stdin
12
24
23
stdout
How many credit hours are you taking this semester?
You should be studing 36 hours.
How many hours do you actually spend studying?
You are only studing 12 hours from what you should actually be spending.
The Estádio Jornalista Mário Filho is 105 m × 68 m.
The Estádio Jornalista Mário Filho is 344.4 ft × 223.04 ft.
The ball circumference is 69.115 in cm.
How many players are going to play?
23
Each player will get to play for 3.91304 minutes.