Create a class called Bill that a hardware store might use to represent a bill for an item sold at the store. A Bill should include three data members—a part number (type string), a quantity of the...


Create a class called Bill that a hardware store might use to represent a bill for an item sold at the store. A Bill should include three data members—a part number (type string), a quantity of the item being purchased (type int) and a price per item (type double). Your class should have a constructor that initializes the three data members. Provide a set and a get function for each data member. In addition, provide a member function named getBillAmount that calculates the bill amount (i.e., multiplies the quantity by the price per item), then returns the amount as an int 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. Write a C++ test program that demonstrates class Bill’s capabilities.





Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here