We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Bill Division
- Discussions
Bill Division
Bill Division
Sort by
recency
|
1787 Discussions
|
Please Login in order to post a comment
Here is my c++ solution you can find the video here : https://youtu.be/MHFroRIBGQc
Splitting bills can be tricky, like when you're with friends at a restaurant. It's like if Top Roofing Contractors in Hartsville charged everyone equally for a job, even if some didn't need the full service.
Here is my c++ solution you can find the video here https://bitlifeapk.org
Java 8
C# * public static void bonAppetit(List bill, int NoEat, int charged) * { * //remove item that she doesn't it from bill list * bill.RemoveAt(NoEat); * //sum the bill and minus the amount charged * int refund = (charged - (bill.Sum()/2)); * //do simple if else then in console.write IF balance is 0, write Bon Appetit else write refund * Console.Write(refund == 0 ? "Bon Appetit": refund); * }