BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Master of Sciences in Computer Sciences > MSCS Semester- II


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 19-04-2012, 11:08 AM
aleeza khan's Avatar
First Time Poster!

 
Join Date: Mar 2012
Location: multan
Posts: 1
Program / Discipline: MCS
Class Roll Number: 6
aleeza khan is on a distinguished road
Default assignment of data structure

We need to store a number of Cricket Players and their Scores in a list using Linked List Data Structure. The data of the players will comprise of their Names and Scores, which means each Node of the Linked List will contain Player Name, Player Score and Next Pointer as follows,

You need to write a C++ Program which contains the following two classes and main function.

We need to store a number of Cricket Players and their Scores in a list using Linked List Data Structure. The data of the players will comprise of their Names and Scores, which means each Node of the Linked List will contain Player Name, Player Score and Next Pointer as follows,

You need to write a C++ Program which contains the following two classes and main function.
  • Player Class (means Node Class):This class should define three private variables for Player Name, Player Score and Next pointer, this class should also define Constructor, Getter and Setter functions for these variable as inline functions (means define these functions within class body).
  • PlayerList Class (means Linked List Class): This Class should define private variables for Header, CurrentPlayer ( means Head pointer, CurrentNode Node) and an int variable which count the number of Players in the Linked List.
The Class should also declare the following methods/Functions,
Constructor(): Default Constructor of the Class.
Add_NewPlayer(): This method should add new player only at the end of list.
Display(): This method should Print the Players information (Names and Score) in the list.
ListLength(): This method should return the total number of Players added in the list.
getTotalScore(): This method should return (print) Total score (e.g score of player1+player2.. etc).

Main Function(): In the main function define an object of the PlayerList class and call the Add_NewPlayer method with this object multiple times (At least two times), then call the Display(), getTotalScore and ListLength functions with this object, your output should look like this.




Reply With Quote
Reply

Tags
assignment, data, structure


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Structure and Algo BSIT 3rd, Mid Term paper by Sir Ahsan Raza .BZU. Data Structure 0 16-11-2010 03:23 PM
Fundamentals of Data Structure - Ellis Horowitz addmaths_07 Data Structure & Algorithem 0 13-03-2010 11:16 AM
Mid Term Paper Data Structure BIT07 & BSC 3rd .BZU. Data Structure 4 07-10-2009 09:29 PM
Data structure in c++ slides Nadeem Iqbal BsCS 3rd Semester 0 04-10-2009 07:01 PM
Data Structure slides Nadeem Iqbal BsCS 3rd Semester 1 09-09-2009 05:16 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 03:35 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.