You are on page 1of 3

Mid-Term Exam (Take-Home) Fall - 2020

Subject: Object Oriented Programming Submission Day: Sunday


Instructor: Tooba, Javeria, Hira, and Rukhsana Submission Date: 28-11-2020
Program: BS (CS/SE) Max. Marks: 25

Department of Faculty of Engineering Sciences and Technology

Please follow the instructions carefully:


1. Write your answers in a Word file and upload the file before the due date on BlackBoard.

2. Write your name and registration ID on the first page of your Word file.

3. Answer scripts can be uploaded on BlackBoard any time before its deadline.
Therefore, do not wait for the last hour to avoid any unforeseen problems.

4. Submission of answer copy(ies) will be considered acceptable through BlackBoard


only. Therefore, do not submit your document through email or any other medium.

5. Use 12 pt. font size and Times New Roman font style along with 1-inch page margins.

6. Follow the requirements of the word limit and the marking criteria while writing your
answers.

7. Provide relevant, original and conceptual answers, as this exam aims to test your ability to
examine, explain, modify or develop concepts discussed in class.

8. Do not copy answers from the internet or other sources. The plagiarism of your answers may
be checked through Turnitin.

9. Recheck your answers before the submission on BlackBoard to correct any content or
language related errors.

10. Double check your word file before uploading it on BlackBoard to ensure that you have
uploaded the correct file with your answers.
Q no. 1 15 Marks

A social networking website hires you to meet the following requirements:


1. User can create their profile
2. User can check for mutual friends
3. User can add new friends
4. User can delete friends
5. Display user’s profile

Solution Guidelines:

Create a class Profile having name, emailId, city , country, friendlist[] ( Keep the fields private)

Profile class will contain following methods:


o createProfile(String name , String emailId, String city,
String country): allow user to set his information
o addFriends(Profile profile): sends request, if a person
accepts the request add the person object into friendlist[]
Note: Achieve Method Overloading keep the parameters as (Profile profile ,
String Message) giving Access to user to send request with a personalized
message.
o removeFriend(Profile profile):can remove a friend from
the friendlist
o showFriends(): display the friendlist
o search(Profile profile):searches for profile in the list if it
exists returns true else return false
o checkMutualFriends(Profile profile): returns an array of
the common friends
Q no. 2 10 Marks
The pandemic has caused a global suffering. Cooperate sectors, social lifes, and educational
institutes every area is disturbed.
A private Primary School takes the initiative as loss in the studies of students knowing the
importance of Education and decides to upgrade the System. Your Team leader gives you the
responsibility to meet the following requirements of the school.
Create Two Classes:
o Parent
o Teacher

Parent:
Data attributes:

 name
 childName
 childroll_no
 childclass

Methods:

 Can launch a complain


 Can view campus news
 Can view Students assignments
 Can view home - assignments score

Teacher:

Data attributes:

 name
 class_number
 array of assignments
 array of quizes

Methods:

 Teacher can upload, assignments and quizzes.


 Can upload Students home – assignments score

Implement code for the above scenario using Object Oriented Programing pillars.

You might also like