Computer Science, asked by araheem98779, 7 months ago


Consider a class Fruit that contains

o A data member named as Fruit Name of string type

o A data member named as Quantity of type int

o A data member named price-per-kg of type double

o A member function displayprice(Fruit) that shows the price of the instrument while evaluating the name of the instrument object that it accepts as a reference parameter

· Derive two classes named Mango and Watermelon from the class Fruit that contain

o A parameterized constructor to initialize data members that they inherit from the class Fruit

In the main(), create instances of Fruit, Mango and Watermelon classes. Invoke displayPrice() with Fruit object while passing references of Mango and Watermelon instances.

Answers

Answered by ishdeepkaur530
1

Answer:

answer will be a data members named as prove name of shipping type ok

Similar questions