Question: Trying to calculate: there will be one server assigned to every 15 guests servers make 15$ an hour and $.50 every minute after an hour.

Trying to calculate: there will be one server assigned to every 15 guests servers make 15$ an hour and $.50 every minute after an hour. Use the ceil function to round up

my work:

int guestNumber;

cout << "enter the number of guests: "

cin >> guest number;

// later on in the program

int serversNeeded = ceil(guestNumber % 15);

the program displays 11 but should display 2 (26 guests % 15 should be around 1.7 rounded up to 2, but again it's displaying 11) so what should I do to fix this?

thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!