View Single Post
  #2   Spotlight this post!  
Unread 10-01-2009, 19:52
neoshaakti's Avatar
neoshaakti neoshaakti is offline
Registered User
FRC #2554 (WarHawks)
Team Role: College Student
 
Join Date: Jul 2007
Rookie Year: 2008
Location: Edison, NJ
Posts: 207
neoshaakti is a splendid one to beholdneoshaakti is a splendid one to beholdneoshaakti is a splendid one to beholdneoshaakti is a splendid one to beholdneoshaakti is a splendid one to beholdneoshaakti is a splendid one to beholdneoshaakti is a splendid one to behold
Send a message via AIM to neoshaakti
Re: C++ Program to Determine Cost Per Student for Regional

Quote:
Originally Posted by Richard McClellan View Post
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