[SOLVED] Problem w/ RobotBarman | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

[SOLVED] Problem w/ RobotBarman

(5th case of C# course, 8th unit project)

31st Dec 2021, 8:26 AM
Igris
2 Answers
+ 3
try { int drinks = Convert.ToInt32(Console.ReadLine()); int shelves = Convert.ToInt32(Console.ReadLine()); //your code goes here Console.WriteLine(drinks/shelves); } /* * 1. DivideByZeroException => "At least 1 shelf" * 2. FormatException => "Please insert an integer" */ catch (DivideByZeroException ex) { Console.WriteLine("At least 1 shelf"); } catch (FormatException ex) { Console.WriteLine("Please insert an integer"); }
31st Dec 2021, 9:08 AM
SoloProg
SoloProg - avatar
0
It's not working bro
31st Dec 2021, 10:32 AM
Igris