Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Assignment No. 01
SEMESTER Fall 2016
CS304- Object Oriented Programming

Total Marks: 20

Due Date:  10 /11/2016

 

Instructions:

Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit if:

 

  • The assignment is submitted after due date.
  • The assignment is submitted via email.
  • The assignment is copied from Internet or from any other student.
  • The submitted assignment does not open or file is corrupt.
  • It is in some format other than .doc (MS Word Document).

 

Note: All types of plagiarism are strictly prohibited.

 

For any query about the assignment, contact at CS304@vu.edu.pk

Objective

The objective of this assignment is:

  • To give you the practical implementation of Class Diagram

 

For any query about the assignment, contact at cs304@vu.edu.pk

GOOD LUCK!

 

Marks: 20 

 

Problem Statement:

The galaxy is composed of the stars, satellite and planets etc.  In earth’s home galaxy, the solar system is comprised of sun (average star) and objects that orbits around it. Following are the 8 largest objects (planets):

1. Mercury

2. Venus

3. Earth

4. Mars

5. Jupiter

6. Saturn

7. Uranus

8. Neptune

The first four planets are called inner planets while the remaining four are outer planets. All planets revolve around the Sun and Satellites revolve around the planet.


 

The tasks you have to do are:

  1. Extract the main objects (entities) from the given scenario.
  2. Find the necessary attributes and functions that need to be associated with each object to implement the functionality mentioned above.
  3. Identify the relationships between these objects.
  4. Construct a final comprehensive Class diagram showing all objects and their relationships along with their attributes and functions.
  5. You have to use UML conventions to draw class diagram. The same has been followed in video lectures as well.

 

Note: You can use any drawing tool such as MS Visio, MS Paint or online drawing tool etc. but you have to paste your diagram in MS Word (.doc) file and submit this file on LMS. Images submitted as solution files will not be accepted.

 

Helping/External Links:

  1. 1.       http://solarviews.com/eng/solarsys.htm
  2. 2.      https://www.draw.io/         (Online Drawing Tool)

 

 

 

Lectures Covered:  This assignment covers Lecture #    1-6

Deadline:            Your assignment must be uploaded/submitted at or before November,10, 2016

 

 

                            

Views: 17689

Replies to This Discussion

Thankz to all of you guys for helping me also to smart.

Helping Material for Assignment

Class :This is a programmer-defined data type, which includes local functions as well as local data. You can think of a class as a template for making many instances of the same kind (or class) of object.

Object An individual instance of the data structure defined by a class. You define a class once and then make many objects that belong to it. Objects are also known as instance.

What is the Difference Between a Class and an Object?

Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.

So what exactly are classes and objects and what is the difference between them?

Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don't change.

The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.

An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change.

Class:

A class is the core of any modern Object Oriented Programming language Class is a blueprint of an object that contains variables for storing data and functions to performing operations on these data. 

Object: 

Objects are the basic run-time entities in an object oriented system.They may represent a person,a place or any item that the program has to handle. 

"Object is a Software bundle of related variable and methods. "

“Object is an instance of a class”

what are data member and functions 

Instance of Object

An instance is an object in memory. Basically you create object and instantiate them when you are using them.

Instance: instance means just creating a reference (copy)

Class Diagram           

Class diagrams are used to represents real life objects in our design by capturing its data methods and relationships of these methods with each other. These classes are basic building blocks of our object oriented system. Class diagrams are represented with white boxes which consist of three parts. Each of these parts has unique characteristics.

The details of these parts are as follow.

  1. The upper part contains the name of the class
  2. The next part contains the attributes of the class.
  3. The third part contains the methods and operations on the class.  

 

Class Diagram Example

OOP: Association, Aggregation, and Composition

Association is a relationship where all objects have their own lifecycle and there is no owner.

Let’s take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers, but there is no ownership between the objects and both have their own lifecycle. Both can be created and deleted independently.

Aggregation is a specialized form of Association where all objects have their own lifecycle, but there is ownership and child objects can not belong to another parent object.

Let’s take an example of Department and teacher. A single teacher can not belong to multiple departments, but if we delete the department, the teacher object will not be destroyed. We can think about it as a “has-a” relationship.

Composition is again specialized form of Aggregation and we can call this as a “death” relationship. It is a strong type of Aggregation. Child object does not have its lifecycle and if parent object is deleted, all child objects will also be deleted.

Let’s take again an example of relationship between House and Rooms. House can contain multiple rooms - there is no independent life of room and any room can not belong to two different houses. If we delete the house - room will automatically be deleted.

Let’s take another example relationship between Questions and Options. Single questions can have multiple options and option can not belong to multiple questions. If we delete the questions, options will automatically be deleted.

The assignment is mostly solved but little bit i had leaved for U to solve fellows

Plz duwao me yaad rakhye ga n assignment me meri red highlights ko parhye ga 

Attachments:

M.S(Invisible Tears)  thanks for sharing 

kindly ak screen short send kary assignment ka...composition main problem ho rahi hai

i m not satisfied to this structure. structure theek hai lekin is mein koi logic nahi dikh rahi 

solar system is a part of galaxy and the solar system include sun, sattlite and planet and if we want to see the organizarion of the univerese then we realize that universe copmosed to galaxy and galaxy composed to solar system................structure aesey baney ga 

kisi nai shi nai kiya he..sab wrong he Uml diagramm also wrong he

ok sub ne wrong kia to aap right solution upload kar dain sir

thek kaha anam aap ny right btao solution

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service