Computer Science, asked by kushagras1234890, 6 months ago

Assume there is a binary file named “stock.dat” which contain the product code(pcode), product
name(pname), product price(price) and Number of quantity(quantity). Write a method void
outOfStock() to display the product details whose quantity is 0.
A super class Data has been defined to store the names and the total sales made by 30
salesmen. Define a sub-class Highest to find the maximum sale along with the name.
The details of both the classes are given below:
Class name: Data
Data members / instance variables:
name[ ] stores names of the salesmen
sale[ ] stores total sale done by each salesman.
Member functions / methods:
Data( ) constructor to initialize data members
void read( ) accepts names and total sales by each salesman
void show( ) displays the names along with the corresponding
sales.
Class name: Highest
Data member / instance variable:
subscript integer to store the subscript of the highest sales.
Member functions / methods:
Highest( ) constructor to invoke the base class constructor
and to initialize subscript = 1
void maximum( ) find the subscript / location of the maximum
sale and stores it in variable subscript without
sorting the array
void show( ) displays the names and sales. Also displays the
name having the highest sales.
Specify the class Data giving details of the constructor, void read( ) and void show( ).
Using the concept of inheritance, specify the class Highest giving details of the
constructor, void maximum and void show( ).

Answers

Answered by surya5299
3

Answer:

integer to store the subscript of the highest sales.

Member functions / methods:

Highest( ) constructor to invoke the base class constructor

and to initialize subscript = 1

void maximum( ) find the subscript / location of the maximum

sale and stores it in variable subscript without

sorting the array

void show( ) displays the names and sales. Also displays the

name having the highest sales.

Specify the class Data giving details of the constructor, void read( ) and void sho

Similar questions