You are using = in your condition, which is assignment. Use == for equality. Alternatively, you can just test the boolean value directly, which I recommend.
I need to store a value into a Boolean variable <hasPremium>. Which is later used in an if-else statement. <H> for true, <N> for false. When I run the program, I get the same output for both <H> and<N>. I have tried every configuration of if-else I know of. My understanding of using boolean variables is little as I am very newb. I tried your suggestion but it did not work (assuming I understood your advice). Inputting an <H> should put 9.99 into the output statement, inputting <N> should leave no output (blank line) Here is my program in its entirety:
Thank you for replying, I understand the concept of boolean. My problem is that I cannot translate the programs' needs into the proper syntax. I have tried everything my rookie brain knows and still, I get the same output no matter what. It is outputting the <if> statement but never the <else>, or vice-versa. I am getting the impression that there is no connection between my input (<hasPremium>), and the if-else statement. My mistakes are usually with data types, or actual/formal parameters, but I can't get past this one.
hasPremium is a bool, what is it that you think this piece of code is doing?
hasPremium should start as false, if they purchase a premium channel, you should then flag them as having premium channels by setting hasPremium to true.
Thank you, it all makes sense after seeing your syntax. My problem was misinterpreting the instructions for the program. The instructions called for hasPremium to be true which I misinterpreted as being true right from the start. It never occured to me to start it as false.
@Albatross
It had to be a bool as per the instructions, which explains why he only wanted a one way selection. I was trying to use 2 and 3 way selections with a bool, obviously the wrong decision, which was probably the whole point of the lesson. Thanks