Quote:
Originally Posted by Liz.2012
Ok so I'm pretty sure my error lies here -
var = if (numPeople <=30 && courseChoice ==1);
{totOnecourse}
|
I think you are in serious trouble and seem to be very confused in your understanding of the basics of Javascript coding, such as the use of the var keyword. I don't see these as "silly errors" - I see these as lack of comprehension. And for the second time you seem to have ignored my advice regarding the position of opening braces and use of semi-colons. Why should I waste more time on this?
In the code I gave you in Post #2
people is the number of people (1-60)
c is the number of courses (1 or 2).
So there are four possible outcomes:-
people <=30 and c == 1
people >30 and c == 1
people <=30 and c == 2
people >30 and c == 2
so
if (people <=30 && c == 1) {
tot = people * 15; // or whatever the cost per head is.
}
if (people <= 30 && c == 2) {
tot = people * 25; // or whatever the cost per head is.
}
One more time,
it is not really in your best interests that others do your all or most homework for you. Your teacher may gain a false and exaggerated idea of your programming capabilities and so not offer you the support you need.
Also, if you hand in other people's work which you do not completely understand, then you will start to fall behind and your difficulties will increase.
I must ask to excused from taking this topic any further. Discuss your problems with your teacher.