View more random threads:
- CS604 Operating Systems Assignment No. 4 Fall 2012-13 Due...
- CS301 Data Structures Assignment No 4 Spring June 2012 full...
- CS602-Computer Graphics Assignment No. 02 Fall 2012
- MTH202 Discrete Mathematics Assignment No.3 solution Fall...
- MGT610 Business Ethics Assignment No.1 Solutuon Fall...
- CS403 Database Management Systems Assignment No. 02...
- CS201 Introduction to ProgrammingAssignment No. 03 Semester...
- CS402 Theory of Automata Assignment No.3 Fall Semester 26th...
- Assignment 3 Of MTH202 Fall 2010 idea solution november 29
- CS410 Visual Programming Assignment No 3 Spring idea ...
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
Sponsored Links
CNIC
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)