Hi Pro players this is leveling up question! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Hi Pro players this is leveling up question!

In this question only the first case is not run, but 4 cases has been done Please help me to complete the first case https://code.sololearn.com/cA8YB4eZPfPg/?ref=app

19th Jan 2021, 5:38 PM
Rahima Mirzad
Rahima Mirzad - avatar
5 Answers
+ 3
if(points>=80) { Console.WriteLine("Level completed"); if(points>=90) Console.WriteLine("Extra gift"); } else Console.WriteLine("You lost");
19th Jan 2021, 5:52 PM
Иван Чикyнов
Иван Чикyнов - avatar
+ 2
Thanks to everyone. Solved
20th Jan 2021, 2:10 AM
Rahima Mirzad
Rahima Mirzad - avatar
+ 1
else is only related to the if statement directly before it, for multiple branches use "else if" Your order of branches is wrong (I guess since task description is missing). Or you could use different conditions. This should be fixed: if(points>=90) Console.WriteLine("Extra gift"); else if(points>=80) Console.WriteLine("Level completed"); else Console.WriteLine("You lost");
19th Jan 2021, 5:49 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 1
Thanks for the help that took a long time
17th Oct 2021, 7:45 PM
Dylan James Quigley
Dylan James Quigley - avatar
0
Why not use parentheses?
20th Jan 2021, 6:53 AM
David
David - avatar