Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS304 Object Oriented Programming Assignment No.4 Solution Spring Semester 2013
#1



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.

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.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,323 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,910 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,929 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,166 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,243 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,969 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,667 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,804 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,702 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,800 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)