Find Jobs
Hire Freelancers

Customer template

$30-60 USD

已完成
已发布超过 19 年前

$30-60 USD

货到付款
Create a class named **[login to view URL]** that is the template that will handle sales for the online book sales company named PhinneyBooks.com. You will be given the amount of the sale, any sale discount applicable will be subtracted, the tax is then added to the net sale amount, and a running total of all sales is kept. For class **[login to view URL]:** · Use a static variable that stores the **taxRate** that is used for all sales that are taxable. · Use another static variable that stores the **saleRate** that is used to identify the sale discount rate. · Each object of the **Customer** class has private instance variables for **customerName**, **listSaleAmount, saleDiscount, netSaleAmount, taxAmount**, **saleTotal,** and **taxable. Taxable** is a boolean variable that stores whether or not the customer pays taxes on their purchases. When books are purchased for re-sale, tax is not charged. A value of true for taxable means that the purchase is taxable; false means not taxable. · A constructor for the class accepts and initializes the **customerName** and the value for **taxable**. · The method called **calculateTax** accepts the **listSaleAmount** for the sale. If a sale is in progress, the **saleDiscount** is calculated, otherwise the **saleDiscount** is set to zero. The **netSaleAmount** is then calculated. If tax is to be charged, the calculation of the **taxAmount** is made, otherwise the **taxAmount** is set at zero. The **saleTotal** is calculated and returned from this method. *continue* ## Deliverables · Another method called **printRecord** returns a string with the **customerName, listSaleAmount, discountAmount, netSaleAmount, taxAmount,** and **saleTotal** for a record on separate lines. All currency fields are properly formatted, to include $ sign. · A static method, **changeTaxAmount**, is sent the new tax amount and sets the tax to the new value. · A static method, **changeSaleRate**, is sent the new sale rate and sets the rate to the new value. · A static method, **printTaxRate**, returns a string with the tax rate in per cent (i.e., 05.55%). · A static method, **printSaleRate**, returns a string with the sale rate in per cent (i.e., 05.55%). Write a driver program named **[login to view URL]** to test the **Customer** class. · Instantiate two **Customer** objects with this data: · **customer1**is an instance of the **Customer** class. Initialize customer1 with data for Annie Smith who purchases book for personal reading and does pay tax. · **customer2**is also an instance of the **Customer** class. Initialize customer2 with data for Bob Wilson who purchases books for re-sale and therefore does not pay tax. · Declare a variable for the totalOfAllSales that will be used to keep a running total of all sales made. Access the changeTaxAmount method to set the initial tax rate to be 8.25%. Access the printTaxRate method to add a line to the output. Access the changeSaleRate method to set the initial discount to 0.00%. Access the printSaleRate method to add a line to the output. Annie Smith orders $65.00 worth of books. Bob Wilson purchases $52.00 worth of books. Access the **calculateTax** method for each sale in order to calculate the net sale amount, tax, and sale total. Add each sale total into the **totalOfAllSales.** Access the **printRecord** method for each sale in order to send a record of the sale to the output. Access the **changeTaxAmount** method to change the tax rate to 8.5% because the county has increased their portion of the tax rate. Access the **printTaxRate** method to add a line to the output. Access the **changeSaleRate** method to change the sale discount to 7.5%, because we have too many books and need to move our inventory. Access the **printSaleRate** method to add a line to the output. Annie Smith makes a second purchase of $84.00. Calculate the tax for this sale and add the total into the **totalOfAllSales**. Bob Wilson makes his second purchase and it’s for $105.00. Calculate the tax and add the total into the **totalOfAllSales**. Access the **printRecord** method for this sale. Add the overall total of sales, with a title, to the output. Turn in a printout of all output produced and your two source code program listings, one for [login to view URL] and one for TestCustomer.java. ## Platform that's all
项目 ID: 3428047

关于此项目

7提案
远程项目
活跃19 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$21.24 USD 在4天之内
5.0 (4条评论)
1.8
1.8
7威客以平均价$33 USD来参与此工作竞价
用户头像
See private message.
$51 USD 在4天之内
5.0 (4条评论)
4.1
4.1
用户头像
See private message.
$42.50 USD 在4天之内
3.3 (8条评论)
4.3
4.3
用户头像
See private message.
$25 USD 在4天之内
4.9 (3条评论)
2.3
2.3
用户头像
See private message.
$29.75 USD 在4天之内
5.0 (4条评论)
1.7
1.7
用户头像
See private message.
$34 USD 在4天之内
5.0 (3条评论)
1.3
1.3
用户头像
See private message.
$25.50 USD 在4天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
United States
5.0
3
会员自11月 11, 2004起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。