Create a class called invoice that a hardware store may use

Assignment Help JAVA Programming
Reference no: EM13809949

Create a class called Invoice that a hardware store may use to represent an invoice for an item sold at the store.  The class should have four (4) instance variables: 

  • part number : string
  • part description : string (what is the item)
  • quantity being purchased : int
  • price per item : double

Create a constructor that initializes the four data members.  Also use default parameters with your constructor.  Create an accessor and mutator for each data member as well.  

Create a member function named getInvoiceAmount that calculates the invoice amount. If the quantity is less than 0, it should be set to 0. If the price per item is also negative, that should be set to 0 as well.

You may create a function that dsplays the receipt.

For extra credit, write a method to overload the ostream and istream operators so any object of the class can be displayed in a cout statement and the object values can be inputted using cin.  E.g.

Invoice i;

cin >> i;

cout << i;

Reference no: EM13809949

Questions Cloud

Scalation of addictive behaviors : scalation of addictive behaviors
Determining the inventory management costs : Safety Firms Inc. sells photographic products using an (R,S) type of control system. SFI is considering investing in a scanner such that they can move from an (R,S) type to an (R,Q) inventory policy. It is expected that with a continuous review po..
Event introducing local meeting planners : You work for an event planning company and you are planning an event introducing local meeting planners to free and easy-to-use technology to incorporate into their meetings.
Discuss the major corporate-level strategy formulation : Discuss the major corporate-level strategy formulation responsibilities.  How are they different from business-level strategy formulation responsibilities?
Create a class called invoice that a hardware store may use : Create a class called Invoice that a hardware store may use to represent an invoice for an item sold at the store.  The class should have four (4) instance variables: part number : string and part description : string (what is the item)
Define the sarbanes-oxley act : The Sarbanes-Oxley Act is intended to increase the confidence of the public and investors through increasing which of the following?
The effects of an unhealthy family system on development : Discuss the effects of an unhealthy family system on development
Show that kirchhoffs voltage and current law : Provide a description of the method that was used to analyze the first circuit - Use the data collected in the second table to show that Kirchhoff's Voltage and Current Law were satisfied.
Evaluating various types of risk : The following Discussion Board task will assist you in evaluating various types of risk. Research at least 2 sources (which may include your textbook) to support your response.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program in java that simulates a simple line editor

Write a program in Java that simulates a simple line editor which supports the following operations

  Write an application bmicalc

Write an application (BMICalc) that reads the user's weight in poinds and height in inches, then calculates the Body Mass Index.

  Define multi-threaded programming in java using locks

Define Multi-threaded Programming in Java Using Locks, To practice programming cooperating, synchronized multiple threads of execution

  Create a gui version of the game mini sudoku.

Each row has the numbers 1 to 6,Each column has the numbers 1 to 6,Each group of 2 rows by 3 columns also has the numbers 1 to 6.

  Calculate the percentage wins of a team

Write a program that will calculate the percentage wins of a team. The program will input the number of wins and losses that a team acquired during a season. The wins should be input in a parameter-less value returning function that returns the wi..

  Projectyou will create a secure parts inventory catalog

projectyou will create a secure parts inventory catalog system using model 2 architecture. the application will require

  Construct the student class student.h

Construct the Student Class Student.h and Student.cpp student class should include a Student.h header file for your class definitions and a Student.cpp implementation file comprised of first name, last name, ram id

  Statistics list program

You will also modify your program to accept input from an input file and print a report to an output file. These files are to be named by the user at runtime.

  Create your own date class

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Trade-offs between quantity and quality of production

Are there inevitable trade-offs between quantity and quality of production and in what ways can job analysis and job redesign help manage there trade-offs?

  Elliptic curve encryption

write a program to implement Elliptic Curve encryption/decryption and program will read parameters, plaintext and ciphertextfrom a file named "input.txt" (under the same directory).

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