Description
Que 1.
In today’s scenario two format of cricket are very famous T20 and ODI. In both format there are 11 players in a team. Player can be either T20 player or an ODI player. Both kind of player has a name, Jersey no and team name to which they belong. For T20 player following record are maintain #No of thirties, Strike rate (to be entered by user). For ODI player #No. of fifties and Centuries. Each Player record can be updated. Each team has a list of player and matches it played, method to add player and delete player.
class team{
public void setFormat (int F)//set format of the team
public void add(Player p)//add player in the team, if player and team format is same public void delete(Player p)// delete player from the team public void Display()// display the name of the player in the team public void addMatch(match m)//add matches that team had played
}
class player{
//Setter getter method for Name, JerseyNo and Teamname
//any other method
}
class match{
match(team a, team b, winner)//accept either team name or index no and winner name or index
}
S.No Implementation
1 Implementing Super Class and it’s function
2. Identify and implement subclass and it’s function
3. Implementation of Team Class
4. Implementation of match class
5 Implementation of main class
• Create Team (3 team)
• Create player
• Add player record
• Add player to a team
• Delete player from a team
• Display team details
• Create match and add it to playing team
• Display matches played by a team along with winner
Que 2:
Mumbai local is divided into different lines, western line, eastern line and harbour line. There are many stations on each line. Each station has a name, line on which it is situated, list of train going through it. Each train has a Name, Train No and the line on which it runs. Train can be of two types local and maintenance. Local train maintain a schedule whereas maintenance train don’t have any fix schedule.
class Station{
public void setName(String Name)
public void setLine (int F)//set Line on which the station is situated western, eastern or harbour line public void add(train p)//add train in the station, if train is of same route public void delete(train p)// delete train from the station
public void Display()// display the name of all the train going from the station
}
class Train{//can be local train or maintenance train //Setter getter method for Name, TrainNo. and LineName
//any other method
}
class Schedule{
Schedule(Station,arrival time, departure time)
}
S.No Implementation
1 Implementing Super Class and it’s function
2. Identify and implement subclass and it’s function
3. Implementation of Station Class
4. Implementation of schedule class
5 Implementation of main class
• Create station (3 team)
• Create train
• Add train schedule
• Add train to a station
• Delete train from a station
• Display station details




Reviews
There are no reviews yet.