Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++// Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice

C++// 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 data members: a part number (string), a part description (string), a quantity of the item being purchased (int), and a price per item (double). Each invoice object represents the purchase of one item.

Your class should have one constructor that accepts four values and initializes the four data members with these values. Provide a set and get function for each data member. In addition, provide a member function called getInvoiceAmount that calculates the invoice amount (quantity * price) and returns this amount. If the quantity is not positive, set it to zero. If the price is not positive set it to zero. Write a main program to test your class.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Prepare an electronic rsum.

Answered: 1 week ago

Question

KEY QUESTION Refer to columns 1 and 6 in the table for question

Answered: 1 week ago