ThoughtWorks公司2014校園招聘作業題

題記

額……昨晚臨睡前在網上搜到了這道題,感覺作業不難,比我想象得簡單。
早晨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……

發佈了30 篇原創文章 · 獲贊 31 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章