How to round up minutes?

Hi,
I'm completely lost. Need to create a program that calculates and outputs a bill for a time service and flat fee.

the requirements:
total number of minutes of service (integer)
hourly charge for service (float)
amount of flat fee (float)

Service is bill hourly and is always rounded up. ex: 61 min of service is billed as 2 hours. 123 minutes is billed as 3hrs, so on and so forth.

Total bill consists of flat fee, the service charge and 4% tax on the service charge (not on the flat fee).

Program should input number of upgrades in the contract and the total seconds (the professor wrote seconds, but i think he meant Minutes) used in a month, then output the amount of the month's bill.

It should not accept inappropriate inputs.

I've done the following and it works, but since I have not defined that 60 minutes = 1hr and 60> =2 hrs , and 123> = 3hrs so on and so forth. It is treating my minutes entry as full hours.
I really appreciate any type of help on this. thank you.

Program:

#include<iostream>
#include<string>
using namespace std;

const float TAX_ON_SERVICE = 0.04;
const string END_PROGRAM_PAUSE_PROMPT = "Press ENTER to finish..." ;

int main (void)
{
// Output Program's Header
cout << "Helen's Ski School Bill Generator" << endl;
cout << endl;

// Output
cout << "Please eneter the following values:" << endl;

float equipment_Fee;
cout << "Equipment Rental Fee -> " ;
cin >> equipment_Fee;

float instructor_Fee;
cout << "Instructor's Rental Fee -> " ;
cin >> instructor_Fee;


float total_Minutes;
cout << "Total Minutes of Instruction -> " ;
cin >> total_Minutes ;
cout << endl;
cin.ignore(99,'\n');
cout << "======================================================================" << endl;
cout << "Lesson Bill" << endl;
cout << endl;

cout << "Equipment Rental Fee $" ;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision (2);
cout.width (11);
cout << equipment_Fee << endl;

float total_instruction_fee = instructor_Fee * total_Minutes;
cout << "Instruction Fee " ;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision (2);
cout.width (17);
cout << total_instruction_fee << endl;

float total_service_tax_fee = total_instruction_fee * TAX_ON_SERVICE;
cout << "Service Tax" ;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision (2);
cout.width (22);
cout << total_service_tax_fee << endl;

cout << " ----------" << endl;


float total_bill_fee = equipment_Fee + total_instruction_fee + total_service_tax_fee;
cout << "Total Bill $" ;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision (2);
cout.width (11);
cout << total_bill_fee << endl;
cout << "======================================================================" << endl;
cout << endl;
cout << END_PROGRAM_PAUSE_PROMPT;
cin.ignore(99,'\n');
return 0;
}
You need to fix the type of total_Minutes, it is supposed to be int.
And then:
int billedHours=(total_Minutes+59)/60;
thank you very much !!
Topic archived. No new replies allowed.