Recent Presidential debates have brought about a series of p

Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results of a public opinion poll.

Program Specifications and requirements:

Your program must use the array templated class library for storing the following:

· presidential candidate names in a one-dimensional array of strings

· four areas of national concern such as “security”, “education”, etc. in a one-dimensional array of strings

· two-dimensional array of integers for storing a count of the total votes of 10000 people for who did better in the debate

For instance, the following could represent the votes for each candidate for 4 areas of national concern:


5460 4540
3999 6001
2000 8000
7000 3000

Assume the first row represents the first area of concern, such as “security”, the second row could represent “education”, etc.

The first column could represent the first presidential candidate, John Brown, and the second column could be for Jim Smith. The particular national concerns and the names of the candidates as well as the votes will come from the keyboard. Do not hardcode any of the data for the arrays. The arrays will be empty to begin with. The data must come from the keyboard. Be sure your keyboard prompts are meaningful and clear to any user. You MUST NOT use any global variables.

The output of your program will be the following:

Display the name of the national concern, the candidate and the percentage of 10000 each candidate received in a nicely formatted table. You will need to use the io manipulators.

Display the name of the candidate that won the debate (highest total of all votes).

You must use at least three meaningful functions in addition to main.

Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results of a public opinion poll.

Program Specifications and requirements:

Your program must use the array templated class library for storing the following:

· presidential candidate names in a one-dimensional array of strings

· four areas of national concern such as “security”, “education”, etc. in a one-dimensional array of strings

· two-dimensional array of integers for storing a count of the total votes of 10000 people for who did better in the debate

For instance, the following could represent the votes for each candidate for 4 areas of national concern:


5460 4540
3999 6001
2000 8000
7000 3000

Assume the first row represents the first area of concern, such as “security”, the second row could represent “education”, etc.

The first column could represent the first presidential candidate, John Brown, and the second column could be for Jim Smith. The particular national concerns and the names of the candidates as well as the votes will come from the keyboard. Do not hardcode any of the data for the arrays. The arrays will be empty to begin with. The data must come from the keyboard. Be sure your keyboard prompts are meaningful and clear to any user. You MUST NOT use any global variables.

The output of your program will be the following:

Display the name of the national concern, the candidate and the percentage of 10000 each candidate received in a nicely formatted table. You will need to use the io manipulators.

Display the name of the candidate that won the debate (highest total of all votes).

You must use at least three meaningful functions in addition to main.

Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results of a public opinion poll.

Program Specifications and requirements:

Your program must use the array templated class library for storing the following:

· presidential candidate names in a one-dimensional array of strings

· four areas of national concern such as “security”, “education”, etc. in a one-dimensional array of strings

· two-dimensional array of integers for storing a count of the total votes of 10000 people for who did better in the debate

For instance, the following could represent the votes for each candidate for 4 areas of national concern:


5460 4540
3999 6001
2000 8000
7000 3000

Assume the first row represents the first area of concern, such as “security”, the second row could represent “education”, etc.

The first column could represent the first presidential candidate, John Brown, and the second column could be for Jim Smith. The particular national concerns and the names of the candidates as well as the votes will come from the keyboard. Do not hardcode any of the data for the arrays. The arrays will be empty to begin with. The data must come from the keyboard. Be sure your keyboard prompts are meaningful and clear to any user. You MUST NOT use any global variables.

The output of your program will be the following:

Display the name of the national concern, the candidate and the percentage of 10000 each candidate received in a nicely formatted table. You will need to use the io manipulators.

Display the name of the candidate that won the debate (highest total of all votes).

You must use at least three meaningful functions in addition to main.

Solution

#include<iostream.h>

template <class T>

class debate

{

T *namea=new char[];

T *nationalc=new int[];

T *percentage=new int[];

T *per=new int[];

T n,i;

public:

Void input()

{

cout<<\"enter total elements\";

cin>>i;

for(n=0;n<i;n++)

{

cout<<\"enter name\";

cin>>namea[n];

}

for(n=0;n<i;n++)

{

cout<<namea[n];

}

cout<<\"enter votes for national concern\";

for(n=0;n<i;n++)

{

cin>>nationalc[n];

}

for(n=0;n<i;n++)

{ cout<<nationalc[n];}

}

void percentagec::input()

{

debate::input();

for(n=0;n<i;n++)

{

cin>>nationalc[n];

sum+ =nationalc[n];

}

percentage[0]=(sum/n)*100;

cout<<percentage[0];

}

void result::percentagec()

{

for(n=0;n<i;++i)

{

cin>>nationalc[i];

}

for(n=0;n<i;++i)

{

per[]=percentage[];

if(per[0]<per[i])

per[0]=per[i];

}

cout<<\"debate winner \"<<per[0];

}

};

void main()

{

debate <int> d;

cout\" \";

cout<<\" Name security education political Judicial\";

cout\" \" ;

d.input();

d.percentagec();

d.result();

}

 Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results
 Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results
 Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results
 Recent Presidential debates have brought about a series of polls analyzing public opinion. Program3 will present a software design (your choice) of the results

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site