Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint โ€” Types

โญ beginnerโณ 18 min read๐Ÿ“ Lesson 9 of 85

Money math and exact formatting, from a blank file.

Checkpoint: the receipt, typed

Task: implement static decimal Total(decimal price, int count, decimal taxRate) returning the after-tax total as a decimal: price * count then apply tax by multiplying by (1 + taxRate). Then implement static string Receipt(decimal total) returning $ + total formatted to exactly 2 decimals (e.g. $59.97).