Create class for hardware store to represent invoice

Assignment Help Programming Languages
Reference no: EM1363423

Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables a part number (type String), a part description (type String), a quantity of the item being purchased (type int) and a price per item (double). Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. Write a test application named InvoiceTest that demonstrates class Invoice's capabilities.

Reference no: EM1363423

Questions Cloud

Illustrate which law do you think texaco was found guilty : In 1976 independent Texaco retailers file suit against Texaco. In 1990, the Supreme Court of the United States found that Texaco had indeed violated antitrust law. Illustrate which law do you think Texaco was found guilty of violating.
Epistemological perspective or stance influence : In what ways does the choice of an epistemological perspective or stance influence the formulation of a management research problem?
Explain how is capital budgeting used in an organization : Explain How is capital budgeting used in an organization and What are the considerations that need to be analyzed when setting up a proposed budget
Accounting problem for yates corporation : Yates Corporation began operations on January 2, 2010. It employs 15 people who work 8-hour days. Each employee earns 10 paid vacation days annually. Please prepare journal entries to record the transactions related to paid vacation days during 201..
Create class for hardware store to represent invoice : Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables a part number.
Accounting for bad debts : What amount of bad debts expense will Hamilton Company report if it uses the direct write-off method of accounting for bad debts?
Variables found in biostatistics : Describe the source of variation which may occur in medicine and how they can affect clinical findings. Secondly, discuss the various types of variables found in biostatistics and how they affect data interpretation.
Explain organizations are challenged to allocate : Explain Organizations are challenged to allocate their resources and people in a manner in which the tasks and goals can be effectively accomplished.
Accounting roles-business organization : What is the difference between a role-based and principle-based system? Discuss Global Reporting initiatives, its purposes, the standard setting process and the use of its reporting system.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Design fraction class to represent numerator and denominator

Design a fraction class. The class should have 2 data members to represent the numerator and denominator. Both of these numbers should obviously be integers.

  Development of computer systems track citizens

To help counter terrorism, many countries are planning and development of computer systems that track large number of citizens and their actions.

  Program to display the bonus

product receives a 5% bonus, otherwise, he receives a 4% bonus. Display the bonus, formatted with a dollar sign and two decimal places, in the bonusLabel.

  Create program to calculate and display number of miles

Create a program to calculate and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the drivers speed.

  Draw diagram shows occupancy of buffer as function of time

A transmitter with rate R bps serves the buffer by sending the bits whenever available. Draw a diagram that shows the occupancy of the buffer as a function of time, for different ranges of values for R.

  Issues into account for collecting user data via forms

In addition to making our forms easy to use we need to consider user privacy and the use of data. What are some of the issues which you believe you require to take into account for collecting user data via forms?

  Write application that allows users to enter student id

Write an application that enables users to enter student ID and three exam scores. Provide a method to compute and return the overall exam average.

  Differentiating heavyweight and lightweight process

What is the difference between a heavyweight and a lightweight process? Give an example of where heavyweight processes are appropriate.

  Executive committee for alleviating it complexity

You are a consultant brought in by the executive committee to make recommendations for alleviating the "IT complexity" concerns of the executives at the company.

  Design program to asks for number of fat grams

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories are not less than 0.

  Define four user-defined exceptions

You will need to define four user-defined exceptions; one for unknown movies, one for unknown member, one for unknown payment method.

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