fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const double meters2Feet = 3.28;
  6. double meterLength = 105.0;
  7. double meterWidth = 68.0;
  8. double feetL;
  9. double feetW;
  10. double circumFerence;
  11. const double piVal= 3.14;
  12. double ballRadiuscm = 11.0;
  13. int players;
  14. double gameTime;
  15.  
  16. //Convert meters into feet
  17. feetL = meterLength * meters2Feet;
  18. feetW = meterWidth * meters2Feet;
  19.  
  20. //Stadium conversions
  21. cout << "The stadiums dimensions are " << feetL <<"ft" << " and " << feetW <<"ft" << endl;
  22.  
  23. //Calculations of the ball
  24. circumFerence = (4/3) * piVal * (ballRadiuscm * ballRadiuscm * ballRadiuscm);
  25.  
  26. //Soccerballs circumference
  27. cout << "The soccersballs circumference is " << circumFerence << "cm" << endl;
  28. return 0;
  29. }
Success #stdin #stdout 0s 4220KB
stdin
Standard input is empty
stdout
The stadiums dimensions are 344.4ft and 223.04ft
The soccersballs circumference is 4179.34cm