PROMOTE MY BLOG: JUST CLICK BELOW BUTTON

Search Any Paper On This Blog

Wednesday, June 29, 2011

::: vuaskari.com ::: CS304

AOA


KINDLY SIR 

SEND ME CS304 ASSIGNMENT NO 4 SOLUTION TODAY IS LAST DAY FOR SUBMISSION PL HELP ME SIR PLEASE SIR


Object Oriented Programming (CS304)

Assignment No.4

 

 

 

 

 

Deadline

Your assignment must be uploaded before or on 29th of June, 2011

 

 

Rules for Marking

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

o                   The assignment is submitted after due date

o                   The assignment is copied

 

 

Objectives

The objectives of this assignment are,

  • Practically implementing Object Oriented concepts using c++.

 

 

 

Assignment

 

Introduction:

In Assignment No.2 and 3 we added basic code in header and implementation files in the form of necessary attributes with suitable data types along with Constructor, Destructor and Getters/Setters for all data members and all other relevant functions belongs to "Topic" and "Sub topic" classes.

 

In this assignment we will finalize our coding by adding different relations among different classes (lesson, course, study program, topic and sub-topic), and writing main program for our complete sub-system.

 

Note: For two classes "Topic" and Sub-topic" you have already developed full code in last assignment. In this assignment, you just need to relate with other classes mentioned above that you can see and help from object model

 

 

 

 

 

 

Here, just only for the sake to update your knowledge there is a guidelines about different concepts that needs to be implemented in this assignment.

 

 

Associations used in Object Model:

As discussed in previous assignments there are three types of associations that may exist between two classes,

 

·        Simple Association

·        Composition

·        Aggregation

 

Simple Association

 

·        We say that simple association exists between two classes in our model when there is no intrinsic (dependency) relationship between two classes, however they are taking services from each other, for example a person and a car or a person and a house.

 

We use line to indicate simple Association between two objects as shown below (it may have no arrow head (two way association), or it may be unidirectional (one way association),

When there is some essential relationship (intrinsic relationship) between two objects then we have either Composition or Aggregation between these two objects as described below,

 

 

Composition:

 

Composition is simply the case when one object is composed of other objects and these objects have no significant independent existence.

 

We use the following symbol for composition

 

 

Examples of composition include,

 

  1. Computer system and its parts like processor, ram and motherboard
  2. Book and its pages
  3. School bag and its handle and pockets
  4. School and Class
  5. School and Library (considering library is part of school and can not exist independently)
  6. Class and Subjects (as this is school so each class has specific subjects in a college or university a single subjects may be added to different study programs)
  7. Library and Librarian
  8. Grade Book and Subject Marks

 

 

Aggregation:

Aggregation also refers to collection of objects, but in case of Aggregation composing objects have their independent existence as well. Its examples include,

 

 

  1. Library and Books,
  2. School and Teacher(As teacher may exist independently as well)
  3. School and Student(As student may exist independently as well)
  4. Grade Book and Subjects
  5. Student and borrowed book
  6. Teacher and borrowed book

 

 

Note that all these objects have relationship with each other but they may exist independently also, we use the following symbol for aggregation,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 Our Object Model is as follows, note that in this model.

 

 

 

 

 

In this assignment, as you need to implement and develop code for "Lesson", Course" and Study Program" classes and finally establish a relationship among all these by taking help from above Object Model (all attributes, functions and relationship is explicitly mentioned respectively).

So, this Object Model is the first and primary guide in order to achieve the desired goals and results.


C++ Implementation

 

Now we see how we can implement these associations present in any Object Model using C++,

 

  1. Composition:

Composition is achieved by adding declaration of object of one class in other object.

  1. Aggregation:

Aggregation is implemented by placing the reference (pointer array) of the aggregating class objects in the class where they are aggregated.

 

We discuss some relations from Implementation point of view,

 

  1. School has many Classes

 

For implementing this relationship we will create objects of type Class in School (equal to number of classes in school). We can do that in School constructor. In school constructor we will ask from user the no. of classes in school and will create an array of Class objects equal to that number. The necessary attributes of each Class object can be set using Class object constructor or for loop and setters methods of each Class.

 

  1. Each Class has many Subjects

 

For implementing this relationship we will create objects of type Subject (equal to number of subjects in that class entered by user). We can do that in Class constructor after setting Class necessary attributes.

 

  1. Each Class has many Students

 

For implementing this relationship we will create objects of type Student in Class object (equal to number of students in that class). We can do that in Class constructor as well.

 

  1. Each Student has Grade Book

 

For implementing this relationship we will create single object of type Grade Book in each Student object. We can do that in Student class constructor.

 

  1. Grade Book has Subject Marks

 

For implementing this relationship we will create objects of type Subject Marks in Grade Book of each student equal to number of subjects in student's class. We can do that in Grade Book constructor.

 

This completes one aspect of system now we move towards library part this part has following relationships,

 

  1. Library has Book

As library aggregates books we will create array of books objects in library class that will independently exist throughout the program.

 

  1. Teacher / Student borrows Book

When teacher or student will borrow book we will set his name in books issued to attribute.

 

  1. Librarian issues Book

When teacher or student will request to borrow some book librarian will issue the book by setting issues to property of Book class.

 

Helping Guidelines:

 

 

  1. It will be better if you go step by step, first add two classes and implement their relationship and then move forward to add one more class and so on…

 

  1. Please before moving towards solution, please have a close view to Object Model and set of guidelines and techniques of how to implement different relationship like Composition and Aggregation between different classes. This will definitely help as it will show how to work in classes and how to implement association relationships and how to create main flow of program. However note that your solution should be better than this as you now have this solution.

 

 

 

Assignment Submission Instructions:

 

You have to upload your complete project folder in zip format.

 

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en

No comments:

Post a Comment

PLEASE COMMENT ABOUT YOUR VISIT AND MY SITE

Note: Only a member of this blog may post a comment.