Help with switch statements!

Yes, I didn’t spot that, “latte” is not recognised as “Latte”

cost is manipulated before multiplikation in the code.

(?) It seems you don’t understand *=

cost *= number;
cost = cost * number;
cost = 1.8 * 10;

1 Like

But where did you get 1.8 from?

Same as with the multiplication.

“Latte”
cost = 2.0,
number = 10 (Discount)
=>

cost -= 0.2
cost = cost - 0.2
cost = 1.8

Guys I had my test today I was wandering if I can post the questions and you can reveal to me the answers so i can check against mine?

I’m guessing, but with a test this early in the semester, isn’t it possible the teacher just want to check the overall knowledge and plan their teaching?

Seems kind of hard to start of like this and then increase the level from here?

Yeah! Feel free to post the questions. Curious to see what is on it :slight_smile: