Quote:
Originally Posted by Richard McClellan
import <math.h>
use ceil (advisor)
to round up
|
Hmm I tried all of those things
Quote:
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <math.h>
using namespace std;
int main(int argc, char* argv[])
{
cout << "Enter number of boys, then Enter Number of Girls" << endl;
int boys ;
int girls;
cin >> boys ;
cin >> girls;
cout << "Number of Advisors needed:" << endl;
int advisors;
advisors = ceil( (boys + girls)/10 ) ;
cout << advisors << endl;
///////////////////////////////////////////////////////////////////////
float room ;
room = ceil(boys/4) + ceil(girls/4) + ceil(advisors/4) ;
cout << "Rooms nedeed:" << room << endl ;
|
but for some reason its not rounding up