Sei sulla pagina 1di 3

Misamis University

Ozamiz City 7200

COLLEGE OF COMPUTER STUDIES

ACTIVITY 05
IMPLEMENTING LINKED LIST

LEARNING OUTCOME:
1. Use the basic operations of a Java LinkedList data structure to create a simple file handling
program.

INSTRUCTIONS:

Using the Java LinkedList, create a simple masterlist of information of any sort (similar to file handling,
say for example, a phonebook). Use the Java LinkedList operations in appending, deleting, or retrieving
the elements. However, you have to create a separate class that will hold the details of your masterlist of
information (which contains the attributes necessary to describe that class).

For example, I created a class named PhoneBook with the necessary attributes (name, phone number,
email address). Then I use the PhoneBook class as a user-defined type in order for the list to hold not
only a single item in one node but the complete attributes of the class. Hence, when the Java LinkedList
will be instantiated with an instance name MyContacts, the data type used in the instantiation of
MyContacts is PhoneBook. This means that MyContacts is a linked list of type PhoneBook.

The program shall allow the user whether to insert a node, delete a node, retrieve the details of a certain
node, or display the complete masterlist. Since phonebook file is used as an example, do not anymore
use this in your program.

To illustrate:

MyContacts
head = 1000 0001

1000 0001 Misha 09121234567 misha@gmail.com 1000 0005


1000 0002 Junne 09264561234 unne.junne@gmail.com 1000 0008
1000 0003
1000 0004
1000 0005 Carly 09260987654 lycar@gmail.com 1000 0002
1000 0006
1000 0007
1000 0008 Shirl 09276789012 chriscely@gmail.com null

memory address Phonebook entries next memory address

1
Misamis University
Ozamiz City 7200

COLLEGE OF COMPUTER STUDIES

ACTIVITY 05
IMPLEMENTING LINKED LIST

RUBRIC FOR GRADING

Criteria Very Satisfactory Satisfactory Fair Poor


(4) (3) (2) (1)
Correctness Program runs and Program works Program executes Program does not
completes all and completes but generates execute
 Declaration of required tasks and most tasks incorrect results correctness
the executes without appropriately and
“masterlist” errors fails to work on
class special cases
 Instantiating a
Java
LinkedList of
type
“masterlist”
 Perform list
operations to
populate
entries
 Perform list
operations to
display entries
 Allow the user
to choose what
operation to be
performed
User-friendly Includes all Some input or Lacks most or all No input/ output
input/output appropriate input output prompts/ input and output description
prompts and descriptions are descriptions
explains/ describes inappropriate or
all output values missing
Variables Variables are Some variable Poor use of Variables used are
named names are variable or incorrect
appropriately and inappropriate or inappropriate use
used efficiently variables are over- of variable names
used or under-used
Formatting/ Well-organized Disorganized tabs Poor use of tabs No use of tabs and
Readability and easy to follow and spaces or it and white space white spaces
through allows readability and is very
appropriate use of by someone who difficult to read
tabbing and white knows what is
spaces supposed to be
doing
Documentation Contains required Header and Comments are too Comments are
heading with comments are general missing

2
Misamis University
Ozamiz City 7200

COLLEGE OF COMPUTER STUDIES

ACTIVITY 05
IMPLEMENTING LINKED LIST

program inappropriate or
description and comments are
appropriate use of poorly described
comments