Showing posts with label cs304. Show all posts
Showing posts with label cs304. Show all posts

CS304 assignment No 01 Spring 2017 Solution and Discussion

By: // 3 comments:

CS304 assignment No 01 Solution and Discussion

Here You can read CS304- Object Oriented Programming Assignment No. 1 Solution and Discussion Spring 2017 . CS304 assignment Deadline : April 27, 2017. Total Marks : 20.

Previously we shared : CS304 Assignment No. 1 Spring 2017.


CS304 assignment No 01 Solution and Discussion
CS304 assignment No 01 Solution and Discussion

CS304 assignment 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).
Please Note: All types of plagiarism are strictly prohibited.

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

CS304 assignment 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

CS304 assignment No 01 Helping Material 

First of All You need to understand few basic concepts:

  • What is Association
  • What is Aggregation
  • What is Composition

What is Association

Association is a relationship where all objects have their own life cycle 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 life cycle. Both can be created and deleted independently.

What is Aggregation

Aggregation is a specialized form of Association where all objects have their own life cycle, 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.

What is Composition

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 life cycle 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.



CS304 assignment No 01 Solution idea

by Syed Hasnat :

Question


Extract the main objects (entities) from the given scenario.
Solution:

(a):Car

(b):Sports Utility vehicle(SUV)

(c):Heavy Duty vehicle(HDV)
Question

Find the necessary attributes and functions that need to be associated with each object to implement the functionality mentioned above.

Solution:

Attributes:

(a):Engine

(b):GearBox

Functions:

(a):SetGear();

For HDV Load(); and UnLoad(); functions will be used.

Question

Identify the relationships between these objects.

Solution:

All the objects will inherit their attributes and function from Class ( Vehicle). The relationship between these objects is association because they all are independent.
Question

Construct a final comprehensive Class diagram showing all objects and their relationships along with their attributes and functions.
Solution:

CS304 assignment No 01 Spring 2017 Solution
CS304 assignment No 01 Spring 2017 Solution

Download CS304 Assignment No 1 Solution file

CS304_Assignment_no_1_Solution.docx

If You liked this Post Please share it with your friends. Thank You

CS304 Assignment No 01 Spring 2017

By: // No comments:

CS304 Assignment No 01

Here is the complete assignment and Solution of CS304 Assignment No 01 Spring 2017. Please discuss the ideas with fellow students about problem.
CS304 Assignment Total Marks: 20 , CS304 Assignment Deadline: April 27, 2017.


You Can Also Download CS304 Solved Mid PapersCS304 Short Notes, CS304 Assignment Solutions, CS304 Lecture Wise Questions Answers Files, CS304 Solved MCQs, CS304 Solved Quiz , CS304 Solved Mid Term Subjective Papers , CS304 Mid Term Objective Papers from Virtual Study Solutions For Preparation of Mid Term Papers.

CS304 Assignment 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

CS304 Assignment No 01 Problem Statement:

There are broadly three kinds of vehicles:
  • Cars
  • Sports Utility Vehicles (SUVs)
  • Heavy Duty Vehicles (HDVs)
Every vehicle has an engine and a gearbox. 
A gearbox is composed of pulleys working according to predefined gear ratios. Cars have smaller engines with 4-6 gears while Sports Utility Vehicles (SUVs) have bigger engines with 4-8 gears. 
Heavy Duty Vehicles (HDVs) on the other hand, are designed to transport cargo thus have huge engines with 8-16 gears. 
The larger the numbers of gears the larger will the number of pulleys and vice versa.

Also Read : Virtual University New Grading Scheme 2017

CS304 Assignment No 01 Tasks

You have to do the following tasks:

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

CS304 Assignment No 01 Solution:

Solution has been updated and Solution file link in .docx also added.

Download CS304 Assignment Solution

CS304 Assignment No 01 Spring 2017 Solution and Discussion

If You want to get the solution in Your mail box as soon as it is updated Subscribe us below.

CS304 Assignment no 3 Solution Fall 2016

By: // No comments:

CS304 Assignment no 3 Fall 2016

Here we have CS304 - Object Oriented Programming Assignment No. 03 Solution and Discussion Fall 2016 , Total Marks: 20, Due Date: 13th Jan, 2017.

You Can Also Download CS304 Solved Final Term Papers, Short Notes, Assignment Solutions, Lecture Wise Questions Answers Files, CS304 Solved MCQs, Solved Quiz ,CS304 Solved Final Term Subjective Papers ,CS304 Solved Final Term Objective Papers from Virtual Study Solutions For Preparation of Final Term Papers.


Also Read: CS402 Assignment no. 3 Solution Fall 2016

CS304 Assignment Objectives:

To get a hands on experience in implementing member initialization list, Inheritance and overriding functions in Object oriented Programming

Also Read: CS601 Assignment no 3 Fall 2016

CS304 Assignment 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 .cpp (Code File).

Note: All types of plagiarism are strictly prohibited.
For any query about the assignment, contact at CS304@vu.edu.pk

CS304 Assignment Problem Statement:

Consider the following part of class diagram in continuation of previous assignments.
Class Diagram
The distance from the sun for all the planets is calculated as the distance from the Earth to the Sun (the AU), where AU is the unit of distance and 1 AU = 150,000,000 km
Following table shows distance of planets from the Sun in AU.
Planet Distance from the sun
Mercury 0.38 AU
Venus 0.723 AU
Earth 1.000 AU
Mars 1.524 AU
Jupiter 5.204 AU
Saturn 9.582 AU

Distance of planet from sun in Kilometer (KM) can be calculated by multiplying distance with the value of AU. For example, If you want to calculate the distance of earth from sun in KM then;
Distance = 1*150,000,00 = 150,000,000

Also Read: CS101 Assignment no 3 Solution Fall 2016

Tasks you have to do:

1. Keeping in view the above given class diagram and scenario, you have to write code for the below mentioned classes and implement their relationship with each other.
2. As Cal_Distance() function will implement the same formula for all inner and outer planets, so you are required to implement this function in Planet class only.
3. You are also required to calculate the distance of Mercury from Sun in Kilometers.
4. 1. Class Planet:

Attribute:
Name: string
Radius: double
Distance: double
Methods/Operations/Getters/Setters:
Print: void
Cal_Distance: double
2. Class Inner_Planet:
Methods/Operations/Getters/Setters:
Print: void
Cal_Distance: double
3. Class Mercury:
Methods/Operations/Getters/Setters:
Print: void
Cal_Distance: double

Also Read: All Subjects Final term Papers

Important points:
• Your program should be able to create an object for Mercury class having a Name, Radius and Distance without creating an explicit object of Planet class.
• All Planet attributes should be directly accessible to Inner_Planet and Mercury and should not be accessible publically.
• Definition of both functions, Print() and Cal_Distance(), should be included in Planet class. Override these functions in Inner_Planet and Mercury classes.
• Display the values of attributes and calculated distance as shown in sample output.

Also Read: CS101 Final Term Past Paper Collection - 1

CS304 Assignment Note:

1. Radius of Mercury is 2440 KM.
2. Use Member Initialization list where needed.
3. You main function should look like this;

CS304 Assignment no 3 Solution Fall 2016


CS304 Assignment no 3 Solution

Here is the Complete Solution file of CS304 Assignment no 3 of fall 2016. Click on the link below to Download the solution file.

CS304_Assignment_3_Solution.cpp 2 KB

CS304 Assignment no.1 Solution Fall 2016

By: // No comments:

CS304 Assignment No. 01 Fall 2016

Today we will discuss the Solution of CS304 Assignment no.1 of SEMESTER Fall 2016.
You can also Download CS304 Current & Past VU Assignments & Solutions

CS304- Object Oriented Programming

CS304 Assignment Total Marks: 20
CS304 Assignment Due Date: 10 /11/2016

CS304 Assignment 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

You should Also Read:

CS304 Assignment Objective

The objective of this CS304 Assignment no.1 is:
To give you the practical implementation of Class Diagram

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

Good Luck to All Students!

CS304 Assignment No. 1

CS304 Assignment 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.
CS304 Assignment Lectures Covered: This assignment covers Lecture # 1-6

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

CS304 Assignment Helping/External Links:

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

CS304 Assignment no.1 Solution

CS304 Assignment # 1 New Correct Idea Solution