Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Assignment No. 05
SEMESTER Spring 2013
CS304- Object Oriented Programming

Total Marks: 20

Due Date: 05/07/2013

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:

  • The assignment is submitted after due date.
  • The submitted assignment is other than .cpp file.
  • The submitted assignment does NOT open or file is corrupted.
  • The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions

 

  • For clarity and simplicity, you are required to Upload/Submit only .CPP file

Objective

The objective of this assignment is:

 

  • To give you the idea of practical implementation of concepts inheritance and polymorphism.

 

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

GOOD LUCK

 

Marks: 20 

Consider the following Class Diagram; detailed description of the diagram is given in the table.

 

Class Name

Attribute Name

Attribute Data Type

Behavior (Functions)

Voter

Password

Character String

-Default Constructor()

-Login _data()

-Cast_vote()

CNIC_No

Integer

Disable

 

 

-Cast_vote()

Overseas

 

 

-Cast_vote()

 

 

In given class diagram, voter is a base class; while Disable and Overseas is its derived classes sharing its all attributes and functions.

 

You are required to implement the above class diagram in C++. For this you have to use the concept of inheritance and polymorphism. In order to cast vote, your program should be able to produce different interfaces for each category of voter e.g. interface for disable voter should be different from the interface of overseas voter.

 

Solution Guidelines:

 

  1. Make Voter base/parent class and inherit classes Disable and Overseas from it.
  2. In voter class:
    1. Make Cast_vote ( ) function a pure virtual function.
    2. Login_data() should be a  non-virtual function.

 

  1. In Disable class:
    1. Make Cast_vote() a virtual function.
    2. Login_data( ) function of disable class should generate an interface that would help disable voters to cast their vote easily. In the body of this function, you also have to call Login_data() function of Voter.

 

  1. In Overseas class:
    1. Make Cast_vote() a virtual function.
    2. Cast_vote()  function of overseas class should generate an interface that would help overseas voters to cast their vote easily. In the body of this function, you also have to call Login_data() function of Voter

Sample Output:

 

 

Lectures Covered:  This assignment covers Lecture #   22-31

Deadline:             Your assignment must be uploaded/submitted at or before. 5th July , 2013

 

Views: 7320

Attachments:

Replies to This Discussion

bhai jan heap wali assignment please upload kr den plz plz sb me 0 aya ha

ye vu walon ka kuch nai hone wala bs jitni b jaldi ho sb apni jan churayen yahan se..........

I Love My VU Family Check That file and tell me as m koe galthi ha tu kyea

 Sorry Dosri file upload kr di thi

Attachments:

error h

pareezy dont mind can u explan error

stay calm dear.... facing the challenges is the Biggest challenge....So, take this as a challenge.

True Say  In Sha Allah VU Family Do It 

solution plz !!!!!

the solution file is working correctly ... error kya hai?

i think ye complete nahe hy Ali bhai option selection hy nahe k button 1 krna hy ya 2

agree dear.. vu walo nay humy meachin smj rakha hy.. behis hain sab vu waly..

jatni mazi complains kr lo koi fark nai parny wala kesi ko be.. upr say hr dafa copy case bana daty hain... 

Dear All Students,

Instead of we disscuss here about vu system. We should all to complain to vu administration to understand us. Where as in other universities they care the students. Here ufffffffffffffffffff.

Regards,

Farhan Ahmed

RSS

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

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