CS506 Assignment 1 Solution Fall 2017
#1
CS506 – Web Design and Development
Assignment No. 01
Semester: Fall 2017

 

Question:
 
You are required to write a program in java that will contain four classes.
 
1. The name of super class should be same as your own VU ID (like BC00000000) and it will have three data members i.e. stdId, stdName and studyProgram. BC00000000 class must have following methods:
 
·         Parameterized constructor that will initialize all the data members with the given values.
·         Getters and Setters for each data member that will get and set the values of data members of class.
·         A display function that will display all the data members of the class.
 
2. The name of second class should be HomeBasedStudent and it will be inherited from super class (BC00000000). It will have two data members i.e. homeAddress and phoneNumber. HomeBasedStudent class must have following methods:
 
·         Parameterized constructor that will initialize all the data members with the given values.
·         Getters and Setters for each data member that will get and set the values of data members of class.
·         A display function that will override the display() method of BC00000000 class and must call display() method of superclass within overridden method before printing data members of HomeBasedStudent class.
3. The name of third class should be CampusBasedStudent and it will also be inherited from super class (BC00000000). It will have three data members i.e.campusName, campusAddress and phoneNumber. CampusBasedStudent class must have following methods:
 
·         Parameterized constructor that will initialize all the data members with the given values.
·         Getters and Setters for each data member that will get and set the values of data members of class.
·         A display function that will override display() method of BC00000000 class and must call display() method of superclass within overridden method before printing data members of CampusBasedStudent class.
4. The name of fourth class should be Driver which will contain the main method. In main method, if you are a home based student then create an instance of class HomeBasedStudent and initialize all the data members with your own VU ID, name, study program, home address and phone number.
 
And, if you are campus based student then create an instance of class CampusBasedStudent and initialize all the data members with your own VU ID, name, study program, campus name, campus address and phone number.
After that, call the display method using the object of relevant class. Your output should be displayed like.
 
In case of home based student:
 
VU ID : BC0000000
Name: Ali
Study Program: BS CS
Home Address: Model Town Lahore
Phone Number: 1234567
 
In case of Campus based student:
 
VU ID : BC0000000
Name: Ali
Study Program: BS CS
Campus Name:            VLHR01
Campus Address: Faisal Town Lahore
Phone Number: 1234567
 
Important Regarding Submission:
 
You must have to provide your own information while initializing object of HomeBasedStudent or CampusBasedStudent otherwise zero marks will be awarded. After completing your code, execute your java file(s) on command prompt and take the screenshot of the output/result. Now, compress your code and screen shot of the output using winzip or winrar and upload it on VULMS.


Solution:
Download attached file for complete CS506 Assignment 1 Solution.


Attached Files
.zip   CS506 Assignment 1 Solution.zip (Size: 91.48 KB / Downloads: 86)
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  CS504 Assignment 1 Solution Fall 2018 Admin 0 781 05-05-2018, 11:11 AM
Last Post: Admin
  CS506 Assignment 3 Solution with explanation aghaJaan 1 1,077 01-23-2018, 11:26 AM
Last Post: Admin
  CS510 Assignment 2 Solution idea Fall 2017 aghaJaan 0 1,013 01-21-2018, 09:55 AM
Last Post: aghaJaan
  CS504 Assignment 1 Solution Fall 2017 Pakistani 0 1,078 11-27-2017, 11:13 PM
Last Post: Pakistani
  CS506 Assignment 2 Solution Fall 2017 Admin 0 1,088 11-23-2017, 10:51 AM
Last Post: Admin
  CS502 Assignment 1 Solution Fall 2017 Pakistani 0 1,046 11-16-2017, 11:53 AM
Last Post: Pakistani
  CS501 Assignment 1 Solution Fall 2017 Pakistani 0 912 11-11-2017, 11:08 AM
Last Post: Pakistani
  CS507 Assignment solution Rubaisha(Moody Girl) 0 617 07-25-2017, 10:23 PM
Last Post: Rubaisha(Moody Girl)
  CS502 Assignment 3 Solution Pakistani 0 1,081 07-18-2017, 10:00 AM
Last Post: Pakistani
  CS506 Assignment No1 Solved 2017 Rubaisha(Moody Girl) 0 1,262 05-05-2017, 02:11 PM
Last Post: Rubaisha(Moody Girl)



Users browsing this thread:
1 Guest(s)