thoughtworks面试题
今天去面试,公司给我用email发了到题,我不太会做,大家一起看看吧。(要求用C++是实现)
PROBLEM TWO: 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...
INPUT:
Input 1:
1 book at 12.49
1 music CD at 14.99
1 chocolate bar at 0.85
Input 2:
1 imported box of chocolates at 10.00
1 imported bottle of perfume at 47.50
Input 3:
1 imported bottle of perfume at 27.99
1 bottle of perfume at 18.99
1 packet of headache pills at 9.75
1 box of imported chocolates at 11.25
OUTPUT
Output 1:
1 book : 12.49
1 music CD: 16.49
1 chocolate bar: 0.85
Sales Taxes: 1.50
Total: 29.83
Output 2:
1 imported box of chocolates: 10.50
1 imported bottle of perfume: 54.65
Sales Taxes: 7.65
Total: 65.15
Output 3:
1 imported bottle of perfume: 32.19
1 bottle of perfume: 20.89
1 packet of headache pills: 9.75
1 imported box of chocolates: 11.85
Sales Taxes: 6.70
Total: 74.68
==========
PROBLEM TWO: 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...
INPUT:
Input 1:
1 book at 12.49
1 music CD at 14.99
1 chocolate bar at 0.85
Input 2:
1 imported box of chocolates at 10.00
1 imported bottle of perfume at 47.50
Input 3:
1 imported bottle of perfume at 27.99
1 bottle of perfume at 18.99
1 packet of headache pills at 9.75
1 box of imported chocolates at 11.25
OUTPUT
Output 1:
1 book : 12.49
1 music CD: 16.49
1 chocolate bar: 0.85
Sales Taxes: 1.50
Total: 29.83
Output 2:
1 imported box of chocolates: 10.50
1 imported bottle of perfume: 54.65
Sales Taxes: 7.65
Total: 65.15
Output 3:
1 imported bottle of perfume: 32.19
1 bottle of perfume: 20.89
1 packet of headache pills: 9.75
1 imported box of chocolates: 11.85
Sales Taxes: 6.70
Total: 74.68
==========
...全文
相关推荐
Thoughtworks公司面试题——MARS ROVERS C#实现带界面展示
本文介绍了基于Windows窗体的应用程序,实现了火星漫游车的模拟功能。程序包含MainForm主界面,支持输入和显示漫游车指令及运行结果,并能从文件加载指令。代码中定义了MarsRover类、Pos
2018秋招ThounghtWorks(思特沃克)笔试面试题
在2018年秋季ThoughtWorks(思特沃克)的招聘流程中,候选人面临着一场编程挑战作为筛选环节。这次笔试面试题包括三个编程问题,要求应聘者熟练掌握Java、Ruby、C#、Python、Clo
thoughtworks测试trains答案
ThoughtWorks是一家全球知名的软件开发公司,以其严格的面试流程和对技术人才的高标准著称。
软件沉思启示录
《软件沉思启示录》是ThoughtWorks公司员工智慧的结晶,它揭示了软件开发领域中的深邃思考与实践经验。
thoughtworks笔试作业
Thoughtworks是一家全球知名的软件开发公司,以其严格的招聘流程和对技术的高标准著称。在Thoughtworks的笔试过程中,应聘者可能会遇到各种技术挑战,其中包括设计模式的运用。


