Joe Wilson

Joe Wilson

  • NA
  • 7.8k
  • 432.8k

How to use inheritance to use 2 class in main class?

May 4 2014 4:04 AM
First,Create a class which is named person which is containing the name and last name and age of the person and this class has a method which named say and print out the persons information which are mentioned (name , last name , ...)
 
then create another class which is named student and this class contain the ID number of students and their field and their average of grades.and this class has a method which named say and print out the students information which are mentioned (ID Number, Field , Average of their grades )
 
the student class is inherited by person class .
 
 make an object fro student class in the main class
 
At last, in the main class  ask user to enter 5 students information like(name, last name, age, ID number, Field, average of numbers)
and save these information  as a package in a file then  when user enter the ONE of the students ID Number then Read the current students information from file and print these information if this ID number has been saved in the File.
 

Answers (4)