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. 04 Total Marks: 20
Semester: Spring 2015
CS304: Object Oriented Programming Due Date: 17/08/2015

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 submitted assignment does not open or file is corrupt.

Assignment is copied(partial or full) from any source (websites, forums, students, etc)

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Microsoft Word Document) or .txt files or

.exe file, no reward will be given in any case.

Objective:

The objective of this assignment is to provide hands on experience of:

Inheritance

Generic Programming Polymorphism

Guidelines:

Code should be properly indented and well commented.

Follow C/C++ guide lines while writing variable names & function names etc. Use only Dev-C++ for this assignment.

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

Assignment

Problem Statement:

In this assignment, write a generic code that will work for all data types. You are required to write a template function named add() in your program. This function will take two arguments of template type that will add these passed parameters and return the result of addition. i.e.

template

T add (T value1, T value2)

Within main() function, you are required to call the template function add() for int, float and Complex types. Now, display the result of all these functions.

int v1 = 5, v2 = 6 ; float x = 2.3, y = 3.5 ;

Complex c1(2, 3), c2(2, 3), t ;

Note: For complex numbers, you will have to create a user defined type.

Sample output of the program:

+ 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: 9288

.

+ 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

chaly students discusion start kry ...phli ko submit krway hoy 2 din nh hoy or pir a gai

Kb khtm ho giii assignments mjhe assignmentaria ho gaya ha doctor ne strictly advise kiya ha assignments se door rehne k liye specially CS-304 is subject se ziyada serious condition ho skti ha.... 

Yeh assignments ke number add hujainge final papers main ....:)

to batoo na kasy bny ge ab y :(

hahahahahaha snober sis how funny

mere ko doctor n bola vu s hi door rhooo 

vu ya cs304 se door rehny ki zaroorat nahiii... ning choor do bukhaar utter jaeey ga

well said

ha ha ha ha ha ha ha

hahahahahahaha

ha ha ha
bas ye last ha Sayyeda Snober g

RSS

Latest Activity

+ ! ! ! ! ! MySterIouS replied to ٹمبکٹو's discussion محبّت اور دل - عشق مجازی
17 minutes ago
+ "J ɨ y ą ⋆ replied to + M.Tariq Malik's discussion CS402 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 15-11-2019 in the group CS402 Theory of Automata
58 minutes ago
+ "J ɨ y ą ⋆ joined + M.Tariq Malik's group
58 minutes ago
+ "J ɨ y ą ⋆ posted discussions
1 hour ago
+ "J ɨ y ą ⋆ liked + ! ! ! ! ! ! BLaiRe ! !+'s blog post ***NooR E KeyAnAT******HaPpy BiRtH DaY
1 hour ago
+ "J ɨ y ą ⋆ liked +¢αяєℓєѕѕ gιяℓ's blog post Now No One Can Break me.........!
1 hour ago
+ "J ɨ y ą ⋆ liked + ! ! ! ! ! ! maho+++'s blog post muhabat k nam pegham
1 hour ago
+ "J ɨ y ą ⋆ liked + ! ! ! ! ! ! ! Ayesha +++'s blog post some suggestions of Hazrat Muhammad (PBUH)
1 hour ago
+ "J ɨ y ą ⋆ liked + ! ! ! ! ! ! maho+++'s blog post Muhammad Mustafa Aye Bahar Andar Bahar Aaye
1 hour ago
+ "J ɨ y ą ⋆ liked + ! ! ! ! ! MySterIouS's blog post + Beginning +
1 hour ago
+ "J ɨ y ą ⋆ liked + ! ! ! ! ! MySterIouS's blog post + Attitude +
1 hour ago
+ "J ɨ y ą ⋆ liked Annu's discussion Please share solution for assig # 01 of wdu 602 fall 2019
1 hour ago
+ "J ɨ y ą ⋆ replied to +¢αяєℓєѕѕ gιяℓ's discussion Mera tu Mohabbat se aitbar.............:-P
1 hour ago
+ "J ɨ y ą ⋆ replied to ٹمبکٹو's discussion محبّت اور دل - عشق مجازی
1 hour ago
+ "J ɨ y ą ⋆ liked +¢αяєℓєѕѕ gιяℓ's discussion Mera tu Mohabbat se aitbar.............:-P
1 hour ago
+ "J ɨ y ą ⋆ liked + M.Tariq Malik's discussion Everyone Freelancer Must Watch it - Most important video for Every fiver user
1 hour ago
+ "J ɨ y ą ⋆ liked + M.Tariq Malik's discussion How to Prepare The Mid Term Exams & Study in VU
1 hour ago
+ "J ɨ y ą ⋆ liked +"Alan Walker"++'s discussion Meri Diary.................
1 hour ago
+ "J ɨ y ą ⋆ liked Muhammad Faheem Iqbal's discussion Hazrat BiBi Zainab ky Mazar-e Aqdas per
1 hour ago
+ "J ɨ y ą ⋆ liked + M.Tariq Malik's discussion Issuance of Semester Voucher for Fall, 2019
1 hour ago

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

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