We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

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
Semester: Fall  2016
Object Oriented Programming – CS304

 

Total Marks: 20

 

Due Date:  13th Jan, 2017

Objectives:

To get a hands on experience in implementing member initialization list, Inheritance and overriding functions 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

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

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

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.

Note:


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


Sample Output is attached :

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 4559

.

+ 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)

Attachments:

Replies to This Discussion

any one complete solution.

This file needs some changes to work fine

Distance Of Mercury From Sun in Kilometers is     zero kyun hai either sample output mein iss ki value  5.7e+007  hai 

Distance Of Mercury From Sun in Kilometers is     zero kyun hai either sample output mein iss ki value  5.7e+007  hai 

CS304 Assignment#03 Solution Check it

Attachments:

cs304 complete solution

Attachments:

CS304: Assignment# 3 Solution Attached

Attachments:

u posted above which one is good??

RSS

Latest Activity

M.Farook joined + M.Tariq Malik's group
46 seconds ago
Faisal izhar liked + M.Tariq Malik's group PSY101 Introduction to Psychology
8 minutes ago
sohaib nafees replied to + M.Tariq Malik's discussion CS507 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 15-11-2019 in the group CS507 Information Systems
17 minutes ago
sobia kiran posted a status
"mgmt 615 mcqs files or past paper require hain quiz ma help kar skata hain koi"
28 minutes ago
Profile IconMudassir Abbas, Muhammad Abbas, Anum and 8 more joined Virtual University of Pakistan
28 minutes ago
Faisal izhar liked ZR's discussion Psy101 quiz1 solved 2018
30 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion BIO302 Molecular Biology Assignment No 01 Fall 2019 Solution & Discussion in the group BIO302 Molecular Biology
31 minutes ago
彡Tweety彡 ❤️ replied to +***piya o ry piya***+'s discussion eng301 solution chahiyaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
34 minutes ago
Fahad replied to + M.Tariq Malik's discussion CS304 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 13-11-2019 in the group CS314 Introduction to Cellular Networks
34 minutes ago
Fahad replied to Ikra butt's discussion CS610 Assignment No 1 Solution Complete And Correct Solution in the group CS610 Computer Network
35 minutes ago
+***piya o ry piya***+ replied to +***piya o ry piya***+'s discussion eng301 solution chahiyaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
37 minutes ago
+ ! ! ! ! ! ! BLaiRe ! !+ liked + Iuuoɔǝut +'s discussion یہ محبت ہی میری خطا ہوگئی
44 minutes ago
+***piya o ry piya***+ replied to +***piya o ry piya***+'s discussion eng301 solution chahiyaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
44 minutes ago
MUHAMMAD USMAN replied to + M.Tariq Malik's discussion MGT611 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 14-11-2019 in the group MGT611 Business & Labor Law
48 minutes ago
Profile IconMUHAMMAD USMAN and Amina Azeem joined + M.Tariq Malik's group
48 minutes ago
+ Iuuoɔǝut + posted a discussion
49 minutes ago
MUHAMMAD USMAN replied to + M.Tariq Malik's discussion CS606 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 14-11-2019 in the group CS606 Compiler Construction
50 minutes ago
MUHAMMAD USMAN joined + M.Tariq Malik's group
50 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion FIN622 Corporate Finance GDB Fall 2019 Solution & Discussion in the group FIN622 Corporate Finance
53 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion FIN622 Corporate Finance GDB Fall 2019 Solution & Discussion
53 minutes ago

Today Top Members 

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

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