Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   I Sell Pagerank   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 12-18-2003, 01:32 PM   #1 (permalink)
Inactive
 
Join Date: 12-10-03
Posts: 14
iTrader: 0 / 0%
Latest Blog:
None

Lord Mike is liked by many
Send a message via AIM to Lord Mike
Borland C++

Anyone have Borland C++ Compiler?
Lord Mike is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 02-25-2006, 01:09 PM   #2 (permalink)
Inactive
 
Join Date: 02-25-06
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

woodham302002 is liked by many
need help

Apologize for being a rookie off top but I am currently writing a program and i have some mathmatical issues. I want to add the sum of all numRooms and let it equal to totRoom and display it for my cout but don't know what exactly to do: here is the program



// Hotel Occupancy


#include <iostream.h>
#include <conio.h>
#include <iomanip.h>


void main ()
{

int numRooms, frequency = 1, numTimes,numFloors, totRooms, roomsOccupied, roomsUnoccupied;
float perOccupied;
char nextFloor = 'y';
cout << "How many floors does the hotel have? "; cin >> numFloors;
cout << fixed << showpoint << setprecision (1);


while ( nextFloor != 'n' )
{
clrscr();
cout << "How many rooms are on floor " << frequency <<" ?"; cin >> numRooms;
cout << "How many of floor " << frequency << " rooms are occupied? "; cin >> roomsOccupied;
clrscr();
cout << "next Floor ( yes or no )?\n";
cin >> nextFloor;
















totRooms = numRooms +
numTimes = frequency++;
roomsUnoccupied = numTimes - roomsOccupied;
perOccupied = roomsOccupied / totRooms;



cout << "\n\nThe hotel has " << totRooms
<< " rooms\n";

cout << "The hotel has " << roomsOccupied
<< " rooms occupied\n";

cout << "The hotel has " << roomsUnoccupied
<< " rooms unoccupied\n";

cout << "The percentage of the rooms occupied is "
<< perOccupied;

}

getch();
}
woodham302002 is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Im having Borland C ++ issues woodham302002 Coding Forum 2 03-06-2006 09:58 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 09:49 PM.
© Copyright 2008 V7 Inc