// busses.cpp
//
// Calculates how many busses are needed
// to transport a given number of people,
// with a given number of seats per bus.
// Uses interactive command-line input (cin).
#include <iostream>
using namespace std;
int main()
{
// Announce purpose of program:
cout << "This program calculates how many busses are"
<< " needed to transport" << endl;
cout << "a given number of people, with a given number"
<< " of seats per bus." << endl;
// Input total number of people and seats per bus:
int totalPeople;
cout << "Enter total number of people (integer):>";
cin >> totalPeople;
int seatsPerBus;
cout << "Enter number of seats per bus (integer):>";
cin >> seatsPerBus;
// Calculate number of busses needed:
int bussesNeeded = totalPeople / seatsPerBus; // initial estimate
if ( totalPeople % seatsPerBus > 0 )
bussesNeeded = bussesNeeded + 1;
// Display the results:
cout << bussesNeeded << " busses of capacity "
<< seatsPerBus
<< " are needed to transport these "
<< totalPeople << " people." << endl;
return 0;
} // function main