题记
额……昨晚临睡前在网上搜到了这道题,感觉作业不难,比我想象得简单。
早晨5:30起来给孩子喂奶,喂完就毫无睡意了,脑袋里只有这道题,跃跃欲试
PROBLEM : SALES TAXES
Basic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical
products that are exempt. Import duty is an additional sales tax applicable on all imported goods
at a rate of 5%, with no exemptions.
When I purchase items I receive a receipt which lists the name of all the items and their price
(including tax), finishing with the total cost of the items, and the total amounts of sales taxes
paid. The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains
(np/100 rounded up to the nearest 0.05) amount of sales tax.
Write an application that prints out the receipt details for these shopping baskets...
额。。。我去参加今年的TW校招了,没想到今年的题仍然是这道……
由于签了保密协定,我把之前写的删掉了…… Sorry……