由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 一个Java问题求解
相关主题
code challenge 求助publication record是什么意思?发表论文的记录
offer选择(FB和TS),顺便贴几个失败的面经Brainbench C++ 200 questions with answer $40/each
Google phone interview questionsopt加急[Update]
讨论一道的BB interview题据信怎么回复啊?
NTSB Position Available - Office of Research & Engineering[算法] unsorted array
National Transportation Safety Board Employment Opportunity (转载)老板这是在夸我还是在骂我
一个google面试题问一下background check
入职体检要hr给表格让医生填的吧?关于OPT90天unemployed过期,是不是只要拿到OFFER就可以了,有经验的进来说说?
相关话题的讨论汇总
话题: enter话题: quantity话题: use话题: total话题: sold
进入JobHunting版参与讨论
1 (共1页)
w*******2
发帖数: 35
1
问题如下:
Write a program to create a customer's bill for a company. The company sells
only five different products: TV, VCR, Remote Controller, CD Player and
Tape Recorder. The unit prices are $400.00, $220, $35.20, $300.00 and $150.
00 respectively. The program must read the quantity of each piece of
equipment purchased from the keyboard. It then, calculates the cost of each
item, the subtotal and the total cost after an 8.25% sales tax. The input
data consists of a set of integers representing the quantities of each item
sold. These integers must be input into the program in a user-friendly way;
that is, the program must prompt the user for each quantity as shown below-
Enter the quantity of TVs sold: 2
Enter the quantity of VCRs sold: 1
Enter the quantity of remote controls sold: 4
Enter the quantity of CD players sold: 1
Enter the quantity of tape recorders sold: 2
QTY DESC PRICE TOTAL
2 Television $400.00 $800.00
1 VCR $220.00 $220.00
4 Remote Control $35.20 $140.80
1 CD Player $300.00 $300.00
2 Tape Recorder $150.00 $300.00

Subtotal: $1760.80
Tax (8.25%): $145.27
Total: $1906.07
Define constants for the unit prices and the tax rate. Use integer variables
to store the quantities for each item. Use floating-point variables to
store the total price of each item, the bill subtotal, the tax amount and
the total amount of the bill. Run your program two times with the following
data:
Set 1 -> 2 1 4 1 2
Set 2 -> 3 0 2 0 21
Format the output adequately showing the 4 columns (QTY, DESCRIPTION, UNIT
PRICE, TOTAL PRICE) in a single row. Use System.out.printf for output.
Use static functions for this problem.
该如何写代码?
求解,不剩感激
t**c
发帖数: 480
2
作业吧?无语。。。
U***A
发帖数: 849
3
难道还在德州?8.25%的税率
1 (共1页)
进入JobHunting版参与讨论
相关主题
关于OPT90天unemployed过期,是不是只要拿到OFFER就可以了,有经验的进来说说?NTSB Position Available - Office of Research & Engineering
Immunization recordNational Transportation Safety Board Employment Opportunity (转载)
之前被fire过,对之后找工作有多大影响?一个google面试题
问个老题入职体检要hr给表格让医生填的吧?
code challenge 求助publication record是什么意思?发表论文的记录
offer选择(FB和TS),顺便贴几个失败的面经Brainbench C++ 200 questions with answer $40/each
Google phone interview questionsopt加急[Update]
讨论一道的BB interview题据信怎么回复啊?
相关话题的讨论汇总
话题: enter话题: quantity话题: use话题: total话题: sold