Need help for C++ programming

Hi,
My name is Lori and I am in beginning programming and need help with an assignment. The program is C++ and the problem is listed below. I have tried everything I can think of but the program run indefinitely. Please help!

Create a program that displays the registration information for programming seminars. The price per person depends on the number of people a company registers. (For example, if a company registers four people, then the amount owed by that company is $400.) The following chart shows the charges per registrant.

Code:

Number of registrants Charge per person ($)
1-3 150
4-9 100
10 or more 90

Use a while loop to allow the user to enter the number of people a company registers. The program should allow the user to enter the number registered for as many companies as desired. Be sure to use an appropriate sentinel value. The program should display the total number of people registered, the total charge, and the average charge per registrant. (For example, if one company registers 4 people and a second company registers 2 people, then the total number of people registered is 6, the total charge is $700, and the average charge per registrant is $116.67.

Whoops! That would be a problem. Also the program does not end when the user enters "S" or "s" and when I enter 3 under the number of registrants, the computer gives an error message. The program just isn't working right and I am at my wits end.

No, it would be a list of values. For instance if you thought the answer was "a, b and c", then you would answer "a, b and c", or "a, b or c" - exact syntax doesn't matter. So "S && s" is just as wrong as "s or S".

In thinking carefully, split the equation into two parts and evaluate each part, then evaluate the overall. So if you are considering 'z' for example, first evaluate "company != 'Z'" (true), then evaluate "company != 'z'" (false), then put them together and evaluate "true or false" (true). The obvious place to start is with S and s, so what is "company != 'S'", "company != 's'", and the results of those OR-ed together.

Also lookup the word "carefully" in the dictionary. Your response was anything but a carefully thought out answer: you just assumed I was being pedantic about syntax, which I wasn't.

I truly meant no disrespect and did not mean to leave the impression that I am not trying to understand all of this. The fact is, is that I have been going over this same program for over a week with very little help from my teacher. It is all starting to look the same and my head starts swimming everytime I look at it. Maybe I just need to delete it all and start over. I appreciate you trying to help and explain things, but I didn't really understand the way that you went about it. Thank you for your help. Would you like to help me start it from the beginning again?

No, I don't think you should start it from the beginning again. I was just trying to help you think through the logic: whenever you are using negative logic it gets confusing quickly, particularly because English works the way you did it, so for example "it's not a donkey or a sheep" is actually expressed as "it's not a donkey AND it's not a sheep". Every animal, including donkeys and sheep, is "not a donkey OR not a sheep":

cat: not a donkey=TRUE; not a sheep=TRUE; TRUE+TRUE=TRUE (+=OR)
donkey: not a donkey=FALSE; not a sheep=TRUE; FALSE+TRUE=TRUE
sheep: not a donkey=TRUE; not a sheep=FALSE; TRUE+FALSE=TRUE
shonkey: not a donkey=FALSE; not a sheep=FALSE; FALSE+FALSE=FALSE

so the expression only evaluates FALSE for an animal that is both a donkey and a sheep, i.e. "not a donkey" and "not a sheep" are both FALSE.

So that is why your loop would never exit. Every character you entered was not S or not s, including both S and s.