Six of us go out and I always end up doing the math.Bill, tip percent, how many people. Tell me what eachperson owes. And round it up, nobody wants to hand overfour dollars and sixteen cents.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
:F2 rounds to the nearest cent, which is not what the brief asks. C# has Math.Ceiling, which rounds a double up to the next whole number; rounding up to the next cent means working in cents for a moment.18 / 100 is 0 in C#.Bill: 98.40 Tip: 18% People: 6Each person owes: $19.36Collected: $116.16 (bill + tip was $116.11)Everyone pays $19.36, which collects five cents more than the bill. That is the brief's rounding doing its job.
Your requirements list and your program file, named cc-tip-split.