Put your knowledge of variables, data types, and arithmetic operators to work! Create a program that divides a restaurant bill evenly between a group of people.
YOUR TASK
Create a program that:
Asks for the total bill amount
Asks for the number of people splitting it
Calculates how much each person owes
Prints the result clearly (e.g. Each person pays: $25.00)
Need a hint?
Step-by-step:
1. Use Console.ReadLine() to read input
2. Convert to numbers: double.Parse(...) and int.Parse(...)
3. Divide: double perPerson = total / people;
4. Print: Console.WriteLine($"Each person pays: ${perPerson:F2}");
Example (input: 100 then 4):
Enter total bill: 100
Enter number of people: 4
Each person pays: $25.00
Code Editor
Ready
Output
Console
Console initialized...
Ready for Project 1: Bill Splitter
> Test your code with the "Check My Code" button
> When it passes, the Complete button will activate!