View more random threads:
- CS408 Human Computer Interaction assignment no 4 fall 2011...
- CS 610 Assignment 5 Sol
- CS403 Database Management Systems assignment no 5 fall...
- Compiler Construction CS606 assignment no 1 spring 2012
- CS502 Fundamentals of Algorithms Spring 2011 ASSIGNMENT4...
- Data Ware Housing CS601 Assignment 2 fall 2010 November...
- CS402 Theory of automata assignment #2 has been uploaded
- CS301‐ Data Structures Assignment No. 01 Spring 2013
- CS402 Quiz # 2
- CS402 theory of Automata assignmment no 4 fall January 2012
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)