Hi guys. I'm currently taking Beginning Visual Basic programming class.
I'm doing my 3rd project but I am completely stuck and cannot continue.
I am doing a project where I have to program a bill generator and I have to include a rate and time expressed in minutes. I kind of understand rounding at least rounding up to the nearest whole number, but I have to round minutes up to the nearest number.
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
// 1.0 Input
cout << "Marlene's Outfit Rental Calculator" << endl << endl;
cout << "Please enter the following values:\n" << endl;
// 1.1 MINUTES RENTED
float rentalMinutes;
cout << "Total Rental Minutes\t-> ";
cin >> rentalMinutes;
//. stuck here
if((rentalMinutes + 0.5) >= (int(rentalMinutes)+1));
cout << rentalMinutes << " rounds to " << int(rentalMinutes)+1 << endl;
// I don't even know what I am doing here.
cout.setf(ios::showpoint);
cout.setf(ios::fixed);
cout.precision(60);
getch();
}
|
For example, if I was to input 61 I am supposed to round it up to the next hour, 120 minutes. Or, if it was 50 minutes I'm supposed to round it to 60.
I can round 61 to 62, but I can get it to round to 120.
Any help would be greatly appreciated guys.
Oh, and this isn't my entire code, I just posted what I am truly having trouble with, the other stuff I can manage. (kinda :P)