We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

assignment No. 03 of CS304 has been uploaded today (Jan 08, 2016). You are required to download assignment file from VULMS and upload your solutions within due date Jan 14, 2016

Assignment No. 03
Semester: Fall  2015
Object Oriented Programming – CS304

 

Total Marks: 20

 

Due Date: 14 Jan, 2016

 

Objectives:

To get a hands on experience in implementing class level association in Object oriented Programming

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

 

 

 

Class Diagram

 

Problem Statement:

Keeping in view the above class diagram, you have to write code for the below mentioned classes and show their relationship with each other:

1. Class Vehicle:

Attribute:

vehicleNo: string

color: string

Methods/Operations/Getters/Setters:

getVehicleNo(): string

getColor(): string

2. Class Car:

distance: int

Methods/Operations/Getters/Setters:

setDistance(int): void

calculateFare(int): int

displayInformation(): void

 

Important points:

  • Your program should be able to create a Car object having a number, color and distance without creating an explicit object of Vehicle class.
  • All Vehicle attributes should be directly accessible to Car and should not be accessible publically.
  • Your program should accept value of distance only between 1-500 kilometers; any other value should be treated as invalid value.
  • At the end, information about Car (car number, car color, distance covered) and total fare should be displayed whereas calculateFare(int) is a utility function. Fare is 5 rupees/kilometer.

 

 

 

 

Output:

BEST OF LUCK

 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 2631

Replies to This Discussion

Asslam

plz do the discussion

This is awesome! Thanks for sharing

most welcome

plz give more solutions

ye lo mze kro

Attachments:

salam plz check 304 assignment 3 solution 

Attachments:

RSS

Looking For Something? Search Here

Latest Activity

Mani Siddiqui BS VIII posted a discussion
43 minutes ago
Mani Siddiqui BS VIII posted a status
"مجھ سے ملتا ہے پر جسم کی سرحد پار نہیں کرتا اس کا مطلب تو بھی مجھ سے سچا پیار نہیں کرتا"
48 minutes ago
Mani Siddiqui BS VIII posted a status
"چند سانسوں کا کھیل ہے باقی پھر تو آپ کو رونا ہی ہے ۔۔۔۔"
1 hour ago
Mani Siddiqui BS VIII posted a status
"جھیل سیف الملوک دیکھی ہے ؟؟ وہ لڑکی اس سے بھی خوبصورت ہے"
1 hour ago
Honey Chaudhary joined +M.Tariq Malik's group
1 hour ago
Honey Chaudhary joined +M.Tariq Malik's group
1 hour ago
Honey Chaudhary joined +M.Tariq Malik's group
1 hour ago
Honey Chaudhary joined +M.Tariq Malik's group
1 hour ago

HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!

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

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

.