Define a class FruitJuice in C++ with the following descriptions: (Self Practice)
Private Members:
Product_Code //integer Data Member to store Product_Code
Flavor //String Data Member to store the flavor of juice (e.g. orange, apple, etc.)
Pack_Type //String Data Member for packaging (e.g. Tetra Pack, PET Bottle, etc.)
Pack_Size //integer Data Member (e.g. 200 ml, 400 ml, etc.)
Price //Float Data member to store Price of the product.
Public Members:
FruitJuice() //Default Constructor to initialize numeric data members to 0 and string data members to " ".
Input() //Member Function to take input.
Discount() //Member Function to reduce the product price by 10 percent
Display() //Member Function to display all the data members after running discount function.
Product_Code //integer Data Member to store Product_Code
Flavor //String Data Member to store the flavor of juice (e.g. orange, apple, etc.)
Pack_Type //String Data Member for packaging (e.g. Tetra Pack, PET Bottle, etc.)
Pack_Size //integer Data Member (e.g. 200 ml, 400 ml, etc.)
Price //Float Data member to store Price of the product.
Public Members:
FruitJuice() //Default Constructor to initialize numeric data members to 0 and string data members to " ".
Input() //Member Function to take input.
Discount() //Member Function to reduce the product price by 10 percent
Display() //Member Function to display all the data members after running discount function.
No comments
Post your comments