yes a windows GUI
i have all my code done but i want to move it to a windows GUI
Code:
#include <iostream.h>
#include <stdlib.h>
#include <lvp\string.h>
int main()
{
// Title that will be displayed in a nice ASCII style box
cout << " ******************************" << endl;
cout << " **** Lab Election Program ****" << endl;
cout << " ******************************" << endl << endl;
// Intro to the program and intructutions for users
cout << "Enter each canidates name and hit enter,";
cout << "then enter the votes for" << endl;
cout << "each candidate." << endl;
cout << "This program will tally the votes and display them in a easy to read table." << endl;
cout <<"* Note this program does";
cout << "not allow spaces for each name, but does allow negative numbers" << endl;
cout << endl;
// Enter the names (no spaces allowed)
String Candidate1, Candidate2, Candidate3;
cout << "Enter the name of the first candidate: ";
cin >> Candidate1;
cout << "Enter the name of the second candidate: ";
cin >> Candidate2;
cout << "Enter the name of the third candidate: ";
cin >> Candidate3;
cout << endl;
// Enter the votes for each candiate for grade 10 (no letters allowed)
long Votes1A, Votes2A, Votes3A;
cout << "Enter the votes for " << Candidate1 << " in grade 10: ";
cin >> Votes1A;
cout << "Enter the votes for " << Candidate2 << " in grade 10: ";
cin >> Votes2A;
cout << "Enter the votes for " << Candidate3 << " in grade 10: ";
cin >> Votes3A;
cout << endl;
// Enter the votes for each candiate for grade 11
long Votes1B, Votes2B, Votes3B;
cout << "Enter the votes for " << Candidate1 << " in grade 11: ";
cin >> Votes1B;
cout << "Enter the votes for " << Candidate2 << " in grade 11: ";
cin >> Votes2B;
cout << "Enter the votes for " << Candidate3 << " in grade 11: ";
cin >> Votes3B;
cout << endl;
// Enter the votes for each candidate for grade 12
long Votes1C, Votes2C, Votes3C;
cout << "Enter the votes for " << Candidate1 << " in grade 12: ";
cin >> Votes1C;
cout << "Enter the votes for " << Candidate2 << " in grade 12: ";
cin >> Votes2C;
cout << "Enter the votes for " << Candidate3 << " in grade 12: ";
cin >> Votes3C;
cout << endl;
// Define the Percentage for each candidate
long VotesTotal = Votes1A + Votes2A + Votes3A + Votes1B + Votes2B + Votes3B + Votes1C + Votes2C + Votes3C;
double Percent1 = 100 * double (Votes1A + Votes1B + Votes1C)/VotesTotal;
double Percent2 = 100 * double (Votes2A + Votes2B + Votes2C)/VotesTotal;
double Percent3 = 100 * double (Votes3A + Votes3B + Votes3C)/VotesTotal;
const int ColWidth = 10;
cout.setf(ios::fixed);
cout.precision(2);
// Display the colum headings.
cout << "-----------------------------------------------------" <<endl;
cout.setf(ios::left);
cout.width(ColWidth); cout << "Candidate";
cout.setf(ios::right);
cout.width(ColWidth); cout << "Votes 10";
cout.width(ColWidth); cout << "Votes 11";
cout.width(ColWidth); cout << "Votes 12";
cout.width(ColWidth); cout << "Percent" << endl;
cout << "-----------------------------------------------------" <<endl;
//Output Results For Candidate 1, Name-Votes-Percent
cout.setf(ios::left);
cout.width(ColWidth); cout << Candidate1;
cout.setf(ios::right);
cout.width(ColWidth); cout << Votes1A;
cout.width(ColWidth); cout << Votes1B;
cout.width(ColWidth); cout << Votes1C;
cout.width(ColWidth); cout << Percent1 << endl;
// Output for Candiate 2, Name-Votes-Percent
cout.setf(ios::left);
cout.width(ColWidth); cout << Candidate2;
cout.setf(ios::right);
cout.width(ColWidth); cout << Votes2A;
cout.width(ColWidth); cout << Votes2B;
cout.width(ColWidth); cout << Votes2C;
cout.width(ColWidth); cout << Percent2 << endl;
// Output for Candiate 3, Name-Votes-Percent
cout.setf(ios::left);
cout.width(ColWidth); cout << Candidate3;
cout.setf(ios::right);
cout.width(ColWidth); cout << Votes3A;
cout.width(ColWidth); cout << Votes3B;
cout.width(ColWidth); cout << Votes3C;
cout.width(ColWidth); cout << Percent3 << endl;
// Total Votes and percent each
cout << "-----------------------------------------------------" <<endl;
cout.width(ColWidth); cout << "TOTAL: ";
cout.width(ColWidth); cout << VotesTotal << endl;
cout << "-----------------------------------------------------" <<endl;
cout << endl;
system("PAUSE");
return 0;
}