Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
2.1k views
in Computer by (49.9k points)
closed by

A superclass Record has been defined to store the names and ranks of 50 students. Define a sub-class Rank to find the highest rank along with the name. 

The details of both classes are given below: 

Class name: Record 

Data members/instance variables:

name[]: to store the names of students 

mk[]: to store the ranks of students 

Member functions: 

Record(): constructor to initialize data members 

void readvalues(): to store the names and ranks 

void display(): displays the names and the corresponding ranks 

Class name: Rank 

Data members/instance variables:

index: integer to store the index of the topmost rank Member functions: 

Rank(): constructor to invoke the base class constructor and to initialize index = 0 

void highest(): finds the index/location of the topmost rank and stores it in the index 

without sorting the array. 

void display(): displays the names and rank along with the name haring the topmost rank.

Under what Principle does the above entity work?

1 Answer

+1 vote
by (49.0k points)
selected by
 
Best answer

Stack works on LIFO (Lost In First Out) principle.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...