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

  Which functions perform assignment score to private member

Consider this class definition: class quiz { public: quiz( ); int f( ); int g( ) const; private: double score; }; Which functions can carry out an assignment score=1.0; to the private member variable score?

  Explain the use of xml dom

When the XMLHttpRequest object receives XML data, it parses and stores the data as an XML DOM object in the responseXML property. Why does the XML DOM used in the above example?

  Design application that would output payment coupons

Design the application that would output 12 payment coupons for each of the 15 apartments in each of the 20 buildings. Each coupon should contain the building number.

  Use two-dimensional array in javascript to solve problem

Using javascript. Use a two-dimensional array to solve the following problem: A company has four salespeople (1 to 4) who sell five different products (1 to 5).

  Develope a tutoring software for an elementary school

You are the project manger for a company that is planning to develope a tutoring software for an elementary school that will follow their curriculum create a work breadown structure.

  Comparing running time of two algorithm

Which algorithm would you prefer on the basis of running time, suppose all other factors equal?

  Design logic for application to allow user to enter item

Design the logic for an application that allows a user to enter an ordered item continuously until a sentinel value is entered. After each item, display its price or the message.

  Write program for real estate agent

Write a program for a real estate agent. The program should perform the following tasks: ask users for the average house price for the each of past 5 years for a single family residence of 1500 square feet.

  Program to compute person earns in a month

Write a program that calculates how much a person earns in a month if the salary is one penny the first day, two pennies the second day, four pennies the third day.

  Program to use a stack to represent list of workers

Write a program to simulate this process. Use the following guidelines.- Use a stack to represent the list of workers. Use a queue to represent the list of people waiting to work.

  Explain relationship between xbrl and semantic web

How do HTML 5, RDF (Resource Description Framework), and OWL (Web Ontology Language) relate to the semantic web? Explain the relationship between XBRL and the semantic web.

  Sql query to retrieve data

Write SQL query to retrieve data from COURSE table for courses.

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