ok so I don't know why my program is doing this but what happiness is when I enter the package I want and the number of HR used it alway goes through the right stuff but then at the end tells me I have an invalid package witch I don't bellow is my code and the out put.... thanks (line 125 is the only problem)
What package did you purchase:
A
Type how many hours you used this month:
50
Your Monthly Charges are = $15
The package you entered is not a real package, please try again.
Your program in general needs a lot of cleaning up. Functions are poorly defined, functions seem to have a lot of identicatal behavior, use of global variables, and inconsistent naming.
You are duplicating a bunch of code. For example - The only difference in these two different functions seems to be the input of a lower case vs an upper case letter? That really shouldn't warrant two different functions to be created and called.
1 2
getpackge();
ValidPackge();
And getpackge sounds like it should be collecting the package type from the user, getHR sounds like it should be collecting the hours from the user, but that's not what those functions do.
The more simple and concise you can make your code, even if it otherwise works, the easier it is to update and maintain later on, by you or by someone else :)
Just because it's working doesn't mean it's a good program. ResidentBiscuit gave you a list of things that can be cleaned up.
More specifically:
1) getpackge() and Validpackge() are identical except for the case of the variable. Why have two nearly identical functions? wildblue already suggested that you look at toupper() or tolower() to avoid having to deal with different cases.
2) Same issue with getHR except the duplicated logic is all in a single function.
3) Lines 10-12 are global variables. Using global variables is a poor practice.
4) Lines 26-29 flow issues. You do invalidcheck() last. Normal flow is to prompt for a particular input, accept the input, then check that the input is valid. If the input is not valid, display an error message and prompt for and accept input again.
5) You have identical couts for monthly_charges all over the place. There is no reason you need more than one (as long as it is in the right place).