Write the following program with C++ Create a class: Bill_Generator The Purchased_item should be having the following data members itemPrice //for per unit price itemQty //for quantity purchased itemAmount[n] // for price of each item, n represent size of the array total_amount //for the total amount of bill that is to be paid items[n] //an array of purchased_item(item names); n represent size of the array   class should have the following member functions Constructor : will take a parameter to set size of items array. getIteminfo(): will take item information calcBill(): will calculate the bill for the items purchased. Give discount of 5% for the purchase greater than 3000 pkr. showBillInfo(): display the bill with items information, given below the output

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 2E
icon
Related questions
Question

Write the following program with C++

Create a class: Bill_Generator

The Purchased_item should be having the following data members

  • itemPrice //for per unit price
  • itemQty //for quantity purchased
  • itemAmount[n] // for price of each item, n represent size of the array
  • total_amount //for the total amount of bill that is to be paid
  • items[n] //an array of purchased_item(item names); n represent size of the array

 

class should have the following member functions

Constructor : will take a parameter to set size of items array.

getIteminfo(): will take item information

calcBill(): will calculate the bill for the items purchased. Give discount of 5% for the purchase greater than 3000 pkr.

showBillInfo(): display the bill with items information, given below the output

item price quantity Amount

LUX 50 5 250

TUC 15 3 45

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr