7. Define a class Departmental with …
CBSE, JEE, NEET, CUET
Question Bank, Mock Tests, Exam Papers
NCERT Solutions, Sample Papers, Notes, Videos
7. Define a class Departmental with the following specification :
private data members
Prod_name string (45 charactes) [ Product name]
Listprice long
Dis_Price long [ Discount Price]
Net long [Net Price ]
Dis_type char(F or N) [ Discount type]
Cal_price() – The store gives a 10% discount on every product it sells. However at the time of festival season the store gives 7% festival discount after 10% regular discount. The discount type can be checked by tracking the discount type. Where ‘F’ means festival and ‘N’ means Non- festival .The Cal_price() will calculate the Discount Price and Net Price on the basis of the following table.
Product Name
List Price(Rs.)
Washing Machine
12000
Colour Television
17000
Refrigerator
18000
OTG
8000
CD Player
4500
public members
Constructor to initialize the string elements with “NULL”, numeric elements with 0 and character elements with ‘N’
Accept() - Ask the store manager to enter Product name, list Price and discount type . The function will invoke Cal_price() to calculate Discount Price and Net Price .
ShowBill() - To generate the bill to the customer with all the details of his/her purchase along with the bill amount including discount price and net price.
Posted by Prateek Gopala 6 years, 1 month ago
- 0 answers
ANSWER
Related Questions
Posted by Prawar Narang 1 year, 3 months ago
- 1 answers
Posted by Hanni Pham 1 year, 1 month ago
- 0 answers
Posted by Kandeepan Jothivel 1 year, 4 months ago
- 2 answers
Posted by Priya Shukla 1 year, 3 months ago
- 1 answers
Posted by Hanni Pham 1 year, 1 month ago
- 1 answers
Posted by Syedali Fathima 1 year, 3 months ago
- 1 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app