|
-
Apr 26th, 2006, 08:53 PM
#1
Thread Starter
Junior Member
external class program
i'm writing a program (if you can call it that) that will basically do this when finished.
reserve a chair, and return the chair ID, or 0 if all chairs are gone. it will also accept the ID of a returned chair and reset the database to show that the chair is available, the returnChair method will return 0 if all went well, and 1 if the user specified an invalid chair...
another program will call the constructor to create 10 chairs, rent them until none left, printing he id of the chair rented... and do the same thing with returned chairs..
Now, this IS a homework problem, I know a lot of people don't give out answers, and im not looking for that, i just want to know if i'm on the right track at all..
Code:
public class Chairs
{
int gotChair;
int returnedChair;
int available[];
}
public Chairs(int gc, int rc)
{
available = new int[11];
for(int i = 0; i<(11); i++) available[i] = false;
getchair = gc;
returnedChair = rc;
}
public int getChair
{
-
Apr 26th, 2006, 10:52 PM
#2
Re: external class program
You have something wrong in almost all lines
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|