fork download
  1. //Cenyao Huang CS1A Homework 2, P. 83, #12
  2.  
  3. /****************************************************************************
  4. * COMPUTE NUMBER OF ACRES
  5. * This program computes the number of acres in a tract of land.
  6. *
  7. * This program uses the formula:
  8. * land_sqFt/oneAcre_sqFt
  9. *
  10. * Input
  11. * oneAcre_sqFt : the number of square feet in one acre
  12. * land_sqFt : the number of square feet in a tract of land
  13. *
  14. * Output
  15. * land_acres : the number of acres in a tract of land
  16. *
  17. *****************************************************************************/
  18.  
  19. #include <iostream>
  20. using namespace std;
  21.  
  22. int main() {
  23. int oneAcre_sqFt = 43560, land_sqFt = 389767; // define variables
  24. int land_acres = land_sqFt/oneAcre_sqFt;
  25.  
  26.  
  27. cout << land_acres;
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
8