Assignment 1 CSC 248
Assignment 1 CSC 248
CAWANGAN PAHANG
KAMPUS RAUB
27600 RAUB
FUNDAMENTALS OF DATA
STRUCTURES
(CSC248)
ASSIGNMENT 1
(Array List, Linked List, Node, Concrete Class Definition and
Application)
ASSIGNMENT 1
(ARRAY LIST, LINKED LIST, NODE, CONCRETE CLASS DEFINITION
AND APPLICATION)
CSC248: FUNDAMENTALS OF DATA STRUCTURES
import java.util.Random;
import java.util.*;
if (prime == true) {
numberMain = new Number(ranNum, "Prime");
primeLnList.addLast(numberMain);
}
if (ranNum % 2 == 0) {
numberMain = new Number(ranNum, "Even");
evenArList.add(numberMain);
} else {
numberMain = new Number(ranNum, "Odd");
oddArList.add(numberMain);
}
i++;
displayEvenNumber(evenArList);
displayOddNumber(oddArList);
displayPrimeNumber(primeLnList);
displayCommonNumber(primeLnList,oddArList,evenArList);
}
System.out.println("Even Number:");
for(int i = 0; i < evenArrList.size();i++)
{
System.out.println(evenArrList.get(i).toString());
}
}
}
}
p=primeLnList1.getNext();
if(p.get_number() == o.get_number())
{
System.out.println("\t" + p.toString()+ " == " + o.toString());
}
}
p=primeLnList1.getNext();
}
}
}
Page 7 of 10
Page 8 of 10
Page 9 of 10
Page 10 of 10
Scoring Rubric
20
Name (Student ID) : __________________________________________________________
Group : __________________________________________________________
Marking Scheme
Remarks
Category
Weak Moderate Good Very Good
Definition of 1 2 3 4
concrete and Concrete and application classes are correctly/sufficiently
application classes defined (including instantiation of object)
1 2 3 4
Clarity of code’s
The source code is clearly written as well as easy to understand.
presentation
Each of the processes is documented.
1 2 3 4
Structure and
algorithm of a The algorithm of the program is capable in solving the problem
program completely. There is no syntax error, logic error and run-time
error.
Object-oriented 1 2 3 4
programming and data Apply a clearly Object-Oriented Programming and data structures
structures concept concepts within the algorithm of the program.
1 2 3 4
Result The program produces expected output with correct and
presentable format.