fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. int creditHours; // variable for credit hours//
  7. int hoursShouldStudy; // variable for equation of hours they should study //
  8. int hoursActualStudy; // variable for the actual amount of hours the person studies //
  9. double stadiumSize; // variable for the stadium size equation //
  10. double ballCircumference; // variable for the ball circumference equation //
  11. int numPlayers; // variable for the number of players//
  12. double playerMin;// variable for the amount of minutes each player can play equation //
  13.  
  14. cout << "Enter The Amount of Credit hours are you taking this Semsemester." << endl; //asking the user to enter they're credit hour amount //
  15. cin >> creditHours; // inputing the number//
  16.  
  17. hoursShouldStudy = creditHours * 3; // equation for determining the amount of study hours//
  18.  
  19. cout << "You should be studying " << hoursShouldStudy << " hours." << endl << endl; // outputting the solution to the equation above//
  20.  
  21. cout << "Please enter how many hours you study for." << endl; // asking the user for the amount of hours they actually study//
  22.  
  23. cin >> hoursActualStudy; // inputing amount of hours//
  24.  
  25. cout << "The difference between how much you should study and how much you study is " << hoursShouldStudy - hoursActualStudy << " hours." << endl << endl; // outputting the solution by taking the hours the person should study and subtracking it from how much they actually study//
  26.  
  27. stadiumSize = (105.0 * 68.0) * 0.3048; // stadium size equation that calulates the size from meters to feet//
  28.  
  29. cout << "The size of the stadium in feet is " << stadiumSize << " ft." << endl << endl; //outtputing the size of the stadium in feet//
  30.  
  31. ballCircumference = M_PI * 22; // equation for the circumference of the ball//
  32.  
  33. cout << "The circumference of the ball is " << ballCircumference << " cm." << endl << endl; // outputting the equation of the ball//
  34.  
  35. cout << "Please enter the number of players you have." << endl; // asking the user to enter the number of players that are on the team //
  36. cin >> numPlayers; // inputting the number of players //
  37.  
  38. playerMin = 90.0 / numPlayers; // Then equation for the amount of minutes that each player can play//
  39.  
  40. cout << "Everyone should be able to play " << playerMin << " minutes." << endl; // outputting the number of minutes each player can play //
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0s 4380KB
stdin
15
2
23
stdout
Enter The Amount of Credit hours are you taking this Semsemester.
You should be studying 45 hours.

Please enter how many hours you study for.
The difference between how much you should study and how much you study is 43 hours.

The size of the stadium in feet is 2176.27 ft.

The circumference of the ball is 69.115 cm.

Please enter the number of players you have.
Everyone should be able to play 3.91304 minutes.