0
PLEASE PROGRAMMING THIS ELECTRICTY BILL
I HAVE ATTACHED PLEASE LOOK IT!!! https://code.sololearn.com/cZjDgqHn29nc/?ref=app
6 Antworten
0
Btw what happens to your code if the user inputs other than the integer of your cases? Let's say 148 or 230? Maybe using switch is not the best solution here. Maybe you should try a condition with <= and >=
+ 1
Very thanks
0
Hello Shubham, 1/you've got some ; misplaced after your if
2/your main function should return tc,
3/you should put switch(u_n) and be careful, switch needs an integer
0
Btw in CASE 150 you're doing (150*0.5+150*0.75) instead of (50*0.5+100*0.75)
0
Why it is necessary to put integer in switch?
0
Because if you write switch('u_n') you are sending u_n as a character to case, and not its value (eg. 50, 150, etc.)