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

  Write a program to model a simple calculator

Write a program to model a simple calculator. Each data line should consist of the next operation to be performed from the list below and the right operand.

  Write a program to read the data from csv file

Write a program that will read the data from the CSV file into an ArrayList of State objects where each State object stores information about all County objects for that state.

  Write program for grocery that reads products data

Write a program for a grocery that reads products data and determine and display the product that has the highest price and the average price.

  Program to fill 0s and 1s into tictactoe board

Write a program which randomly fills in 0s and 1s into TicTacToe board, prints board.

  Write a program to read student data from standard input

Write a program to read student data from standard input, sort it by last name / first name, and print result to standard output.

  Create nested menus interface for a check-in hotel

Create a nested menus interface for a check-in and check-out hotel reservation system that can be used internationally. Use numbers to select a menu item.

  Complete a request for system services

Objectives Complete a Request for System Services form, which triggers the preliminary investigation phase. Analyze a user interview and extract pertinent facts, which can be used to assess project feasibility. Complete a Problem Stateme..

  Html/css

"Validating Your Work" Please respond to the following:  Describe attribute minimization. Explain what would happen if you tried to validate a page containing instances of attribute minimization. Propose a solution to this problem.

  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.

  Differentiating client-side and server-side scripting

Understanding difference between client-side and server-side scripting is significant when developing interactive sites. When and why should you use client-side versus server-side scripting?

  Program to read list up to hundred addresses

efine a class called address_t with members for the four integers. Your program should read a list up to 100 addresses and nicknames terminated by a sentinel address of all zeros and nickname.

  Create application which permits user to input a price

Create an application which allows a user to input a price until suiatble sentinel value is entered. Output is a price of each item on each day,one through seven.

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