Computer Science Canada Switch Function Problems! |
Author: | blissfullydysphoric [ Thu Oct 02, 2008 7:33 pm ] | ||
Post subject: | Switch Function Problems! | ||
Hi, I am having troubles with my switch. All my program does right now is takes the users input and uses it to determine what the value is for that specific type of pipeing.
It works for all of the cases except for the first because I cannot get the if statements to work :S When I enter an age in the program crashes. |
Author: | Clayton [ Thu Oct 02, 2008 7:37 pm ] | ||||
Post subject: | RE:Switch Function Problems! | ||||
The logic in your conditions here seem a little off... rewriting it we get this:
What exactly are you trying to do? |
Author: | blissfullydysphoric [ Thu Oct 02, 2008 7:42 pm ] |
Post subject: | RE:Switch Function Problems! |
Basically if the age is between 0 and 10 the c_factor is 130, likewise if the age is between 20 and 30 the c_factor is 95. If the age is 0 then the c_Factor is still 130 and if the age is 20 then the c_factor is 95. |
Author: | blissfullydysphoric [ Thu Oct 02, 2008 8:02 pm ] |
Post subject: | RE:Switch Function Problems! |
Thanks for the help you did solve my problem, I didn't realize the greater than signs were going the wrong direction :S |