View more random threads:
- CS304 Object Oriented Programming spring 2011 idea solution
- CS410 Visual Programming Assignment No 3 Spring idea ...
- MTH603 Numerical Analysis Assignment 1 Idea Solution...
- MTH 603 18 importent Formule For Final Term
- MTH401 IDEA solution fall 2010 November, 8th
- IT430 E Commerce Assignment No 03 Semester 31 May Spring...
- CS602 Computer Graphics Assignment No.1 Solution Spring...
- cs403 assignment 2015
- CS403 Assignment No. 03 Solution 23rd January 2016
- cs501 Assignment no 3 Solution 20th January 2016
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
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.
Sponsored Links
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)