subject

Write a CashRegister class that can be used with the RetailItem class that you wrote in Chapter 6’s Programming Challenge 4. The CashRegister class should simulate the sale of a retail item. It should have a constructor that accepts a RetailItem object as an argument. The constructor should also accept an integer that represents the quantity of items being purchased. In addition, the class should have the following methods: • The getSubtotal method should return the subtotal of the sale, which is the quantity multiplied by the price. This method must get the price from the RetailItem object that was passed as an argument to the constructor. • The getTax method should return the amount of sales tax on the purchase. The sales tax rate is 6 percent of a retail sale. • The getTotal method should return the total of the sale, which is the subtotal plus the sales tax. Demonstrate the class in a program that asks the user for the quantity of items being purchased, and then displays the sale’s subtotal, amount of sales tax, and total.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:40
State the parts of a variable declaration?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
You know the right answer?
Write a CashRegister class that can be used with the RetailItem class that you wrote in Chapter 6’s...
Questions
question
Arts, 20.03.2021 18:30
question
Business, 20.03.2021 18:30
question
Biology, 20.03.2021 18:30
question
History, 20.03.2021 18:30
Questions on the website: 13722363