View more random threads:
- CS403 assignment no 5 fall 2010 solution on 29/01/2011
- cs201 assignment no 3 idea solution spring June 2011
- Visual Programming (CS410) Assignment no 3 solution fall...
- CS408 assignment no 4 fall January 2012
- Operating System- CS604 Assignment # 3 fall 2010 date...
- cs601 assignment no 1 idea solution fall 2011 on 28th...
- CS302- Digital Logic Design Assignment 3 solution fall 2010
- cs403 assignment 2015
- mcs cs408 assignment no 1 for may spring 2015 semester for...
- CS408 Human Computer Interaction Assignment No.5 Fall...
CS304 Object Oriented Programming Assignment No.4 Solution Spring Semester 2013
Consider Candidate class from E-Voting System discussed in Assignment No. 01. Class Details are given as follows:
Class Name
Attribute Name
Attribute Data Type
Functions
Candidate
CNIC
Sponsored Links
Integer/Character String
-Default constructor()
First_Name
Character String
-Function to overload stream extraction operator ( >>)
Last_Name
Character String
- Function to overload stream insertion operator ()
Sign_Alloted
Character String
-Function to overload comparison operator (= = )
Write a Program in C++ that implements the candidate class with given attributes and functions. Your program should be able to do the following:
There should be a default constructor to initialize data members of candidate class.
There should be a function to overload stream extraction operator so that we should take input for each object data members directly from main function using cin statement e.g. cin>>Candidate1.
Note: Make sure you take input against each data member specified in above table.
While inputting, you also have to check for duplicate records i.e. information of a single candidate should not be entered more than one. For this, you have to overload “= =” operator so that comparison operation would be performed on objects directly in main( ) function by writing this type of statement C1= = C2.
There should be a function to overload stream insertion operator so that we should display each object data directly from main function using cout statement e.g. . coutCandidate1.
In main() function, you are required to create an array of objects to store candidates information. For example if you want to register data of 5 candidates, you should create an array of 5 objects.
Sample Output:
For sample output look the attached animated GIF file.
There are currently 1 users browsing this thread. (0 members and 1 guests)