thanks for replying to my problem,
the idea behind this project is to declare two classes, guest and room. and make an association between the two classes. the main function is just a way to check that a dynamic object of guest is created within a member function of room class, I have called this allocateGuest() . also, when the guest 'checks out' the dynamic object of guest is destroyed, - deAllocateGuest (). the amount of money owed by each...
User Profile
Collapse
-
dynamic objects, agregation and calling member functions
hi guys,
can you look at my main frunction and give me any help on how to get this program to work without copying the block of code twice (as in this code).
I have tryed to put the code into a function and then basically called it twice but the updateBill member function does not work correctly ( it does when the code is copyed ). i also thought about using a for loop, this works but I then must assume that i want to run this code... -
THANKS !!
now you have explaned it it does seem obvious, such is the way with these things, they are easy only when you know the answer.Leave a comment:
-
if statement problem?
Hi,
I wonder if somebody can see my error?
I would assume that these if statements would be valid only if 'y' or 'Y' is entered, and if any other character is entered the default string declared for the variables would be displayed, however this is not the case! I have looked over this section of code so many times and can not see my error.
any input would be greatly appreciated.
...Code:void main(void) { -
passing arrays into a structure
just a quick question...
can anyone tell me if it is possible to pass info held in an array of a structure to a seperate function? (i am using C)
thanks -
Thankyou very much for your help, I have a working program at last!!!
(why do things seem obvious when you have the answer !)
My course is moving on to C++ next, so I guess I will be scanning the archives of this forum pretty soon.
Thanks again,
Phil Cornwall (England)....Leave a comment:
-
Thanks, I have been trying to fix my problem and got a little further, but now the values are not showing at all !!
...Code:for (count = 0;count <noEmployees; count++) do { printf ("%s\nPlease enter the tarrif code:\t",employee[count].name); scanf("%d",&tarrifCode); printf ("\nnumber of contracts negotiated for this tarrif:\t");Leave a comment:
-
assignment from hell !!
Hi everybody,
I have compleated an assignment in C for college and was very pleased with myself until I saw that extra marks could be obtained by modifiying the working program to meet a new criteria.
at present the program excepts an integer as 'amount of contracts sold' for each of 5 employees, the employees are defined in a structure with all the information set out in the assignment brief.
the program then (via 'for loops'),... -
-
sorry, another newbie question on loops!
Hi guys, sorry but yet another newbie struggling with the basics!
I have a small program that i am working on in wich 1 want to enter exam scores for each of 5 students in turn untill i enter a set number to stop the loop and carry on with the program, the loop i have come up with is bellow but it keeps going and ignores my set number, can anyone shed any light on this problem loop??
[HTML]while ( score[count]!= -999)
... -
Thankyou so much, I have now learned to look over the basics before trying to find complicated answers!!...Leave a comment:
-
Hi, thanks for replying. first I have inserted the for loop that does work for each employee:
...Code:for (count = 0;count <noEmployees; count++) { if (employee[count].totalContracts > 5) totalPay = employee[count].totalContracts + 100; /* bonus £100 for over 5 contracts*/ totalPay = employee[count].basicPay + (employee[count].totalContracts * 25); /*bonusLeave a comment:
-
Loop not working in assignment
Hi everyone,
I have had a look through the site but can't find anything to help with a little problem i am experiencing with a college assignment. I wonder if anyone would like to help out?
My assignment is : the program should prompt the operator to enter the number of contracts negotiated this week.
After all data has been entered, the program should display the following information for each employee:
Number... -
Thanks for you help on this subject, I have found a solution although not ideal it works! To combat portability issues etc. I have installed the borland compiler on my p.c at work and set up a remote access for my mac, this way i can sit at home on my mac and have the benifits of borland on windows.
bit of a cheat but like i say it works!...Leave a comment:
-
Borland vs Xcode
Can anyone help??
I have just started a C / C++ course at my local college and they use borland c++ builder 5, I use an imac at home and have downloaded xcode as my c++ compiler, it works beatifully but now I find out that borland 5 uses different code to the ANSI standard that xcode can compile, is their an easy conversion / program so that I can write and compile borland in xcode or am I wishing for the impossible? any help or alternative...
No activity results to display
Show More
Leave a comment: