Assignment No. 01
SEMESTER Spring 2011
CS506- Web Design and Development
Instructions 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 assignment does not open or file corrupt.
o The assignment is copied (from other student or ditto copy from handouts or internet).
o Student ID is not mentioned in the assignment File or name of file is other than student ID.
Marks: 15
Question: Write a program in notepad that contains two classes one of the Person and other of Clerk where Person is the Super or parent class of the Office Clerk.Also show clerk object being capable showing data stored in it. You are required to follow all Object Oriented Programming rules including Naming conventions, Overloading, Overriding, Default constructor, Setter and getter methods etc.
Note: All the source code should be written manually. Your code must justify enough for 15 marks.
Lectures Covered: This assignment covers Lecture # 01-06
Deadline
Your assignment must be uploaded/submitted at or before 07/04/2011.
Uploading instructions Your Submission must include:
1. All the Source Code (.java file) and other if necessary files to compile and run your program.
2. If and only if there are multiple files to submit place all the files in a Zip file and Upload it on VULMS else only source code file is required to be submitted.
Note: Use Notepad for coding and JDK package for java source code compilation and running (JDK is also available on download section of VULMS)
Objective
The objective of this assignment is
O To give you some practice exercise of Inheritance.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
IDEA Solution:
public class Person
{
private data members;
public data members
Person()
{//constructor}
//data methods
getVal()
{//function to get values of data members
}
setVal(parameters)
{//function to set values of data members
}}
class Clerk extends Person
{
data members
Clerk()
{//constructor
assign data members 0 or any default value you want}
//data methods
}