program w/ switch AND nested if. six error messages
Expand Post »
Hello,
this is my first post, so i'm sure i'll fumble it a little bit.
I'm writing a program that has a switch, a nested if, and an output choice of console or new file on a:.
I feel like all my switch and nest is good, but i'm missing something, like a preprocessor. at least i hope I'm that close
here's a list of errors:
LINE 49 call to undefined function 'SWITCH' in function main()
LINE 49statement missing ; in function main()
LINE 96possible use of tot_chrg' before definition in function main()
LINE 101undefined symbol 'choice in function main()
LINES 113 115 117 119 statement missing ; in function main // this appears four times
LINE 127[three of my different variable names: water_chrg school_fee elec_chrg] are used but never defined in function main()
LINE 127[two of my variable names: bal_due SAN_CHARGE] is assigned a value that is never used in function main()
Re: program w/ switch AND nested if. six error messages
>I guess i'm not exactly sure what 'defined' means
Your variable tells the compiler, "Here I am! I exist. Set aside storage for me." And you do it like so:
Re: program w/ switch AND nested if. six error messages
>I guess I'm in over my head
One problem at a time. Change your keywords (switch, if, else, and so on) to lower case first, then you should compile with only warnings and we'll work from there.
Re: program w/ switch AND nested if. six error messages
Okay, now include <iostream.h> and declare your variables. Notice that what we're doing here is incremental fixes. There are so many problems that you can only work with one at a time, so you walk down the list of errors from the top, recompiling as you fix them because sometimes one fix will remove several error messages.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.