Demonstrate the class in a program

Assignment Help Basic Computer Science
Reference no: EM131014845

Q 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 passes as an arugument 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

Reference no: EM131014845

Questions Cloud

Calculate the projects annual free cash flow : Breakeven Sensitivity Analysis The Clayton Manufacturing Company is considering an investment in a new automated inventory system for its warehouse that will provide cash savings to the firm over the next five years.  Calculate the project’s annual f..
Expected interest rate on a one-year treasury bond : As of 09/17/2014, what was the expected interest rate on a one-year treasury bond on 09/17/2015? Please use the expectations theory. As of 09/17/2014, the expected interest rate on a one-year treasury bond If there the expected and the actual interes..
Approximate the maximum possible percent error : Approximate the maximum possible percent error in the calculated volume by using the total differential as an approximation to volume change.
Returns for the first investment will be paid in nominal : You have $2000 to invest, and are choosing between two projects, both of which cost $2000 up front and will yield six years of returns. The returns for the first investment will be paid in nominal $, starting at $400 a year from now and increasing at..
Demonstrate the class in a program : 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
Which project has the higher equivalent annual net benefit : The company you work for is trying to decide between two projects. Project 1 costs $200,000 up front, and has an expected life of 5 years, over which it will return $40,000 each of the five years. Project 2 would last for 15 years, costs $1 million u..
Tuition financing plan : Wayne State offers a tuition financing plan where a $40,000 loan taken at the beginning of the freshman year would pay for all 4 years of college tuition. The plan calls for the loan to be repaid over a ten year period starting 5 years from the date ..
Find the distance between the two parallel planes : Find the distance between the two parallel planes : 5x + y - z = 1 and 10* + 2y - 2z = 5. You should be able to use your plan above to help with this one.
Define a class client which has attributes name : Your menu should allow you to add new clients, accept payments from clients using the client's name, make loans, look up a client's balance, remove a client,

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Differences and similarities between ieee 802-11 frame

What are the differences and similarities between an IEEE 802.11 frame and an Ethernet frame?

  How much video memory is required to store the picture

What is the transfer rate, in bytes per second, required to move the pixels from video memory to the screen for the "true color" image?

  Evaluate issues and challenges associated with integration

Evaluate the issues and challenges associated with information technology integration and summarize the competitive advantage that information technology affords to organizations.

  Write a jsp page that implements a page hit counter

Write a JSP Page that implements a page hit counter. Every time user loads this page a counter is incremented and displayed. a.Use JSP declaration tag to declare the counter variable.

  Design a payroll class

Write the appropriate accessor and mutator methods and a constructor that accepts the employee's name and ID number as arguments.

  Which of two alternatives you should pursue

The WBS identifies all of the work that must be done to complete the project

  Minimum positive subsequence sum

1. Give ef?cient algorithms (along with running time analyses) to a. Find the minimum subsequence sum. b. Find the minimum positive subsequence sum.

  Explaining organization management responsibilities

Describe in scholarly detail common organization management responsibilities.

  What is the probability of net loss of the whole packet

Suppose an IP packet is fragmented into 10 fragments, each with 1% (independent) probability of loss. To a reasonable approximation, this means there is a 10% chance of losing the whole packet due to loss of a fragment. What is the probability of net..

  Why do some block cipher modes of operation only

Why do some block cipher modes of operation only use encryption while others use both encryption and decryption?

  Given the churn data for training and test

Given the churn data for training and test, develop models using different techniques i.e. "Logistic Regression", "Decision Trees", "Random Forests" and "Neural Networks".

  Monte carlo estimation of areas

Programming Project - Monte Carlo estimation of areas It is a programming project using the BlueJ ( Java language) .

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd