

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Assignment No. 01 SEMESTER Spring 2012 CS301‐ Data Structures Total Marks: 20 Due Date: April 12, 2012
Please read the following instructions carefully before solving & submitting assignment: It should be clear that your assignment will not get any credit (zero marks) if: o The assignment is submitted after due date. o The submitted code does NOT compile. o The submitted assignment is other than .CPP file. o The submitted assignment does NOT open or file is corrupted. o The assignment is copied (from other student or ditto copy from handouts or internet).
For clarity and simplicity, You are required to Upload/Submit only ONE .CPP file. Note: Use ONLY Dev‐C++ IDE.
The objective of this assignment is o To make you familiar with Programming the Linked list Data Structure. GOOD LUCK Marks: 20 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 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).
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).
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.