Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Your company has been hired to develop a new voting system for the upcoming Pres

ID: 3829817 • Letter: Y

Question

Your company has been hired to develop a new voting system for the upcoming Presidential Elections. Your boss comes to you and ask you to be the head developer to complete this task. He explained the main problems of the current system and at the same time gives you the requirements for the new system which are as follows: System Configuration: a. System must be capable to configure which parties are involved in the presidential elections (ex: Democratic, Republican, Independent, etc.) b. System must be capable to configure the president candidate's names (ex: Hillary Clinton, Donald Trump, etc.) c. System must be capable to configure the vice president candidate's names (ex: Bernie Sanders, Ted Cruz, etc.) d. System must be capable to run endlessly unless a sentinel character is entered. System Output Display (Each ballot must contain the following information) a. A welcome greeting message must be displayed explaining the voter how to use the new voting system. b. Display candidates and Party information i. Candidate's name and Party (President) ii. Candidate's name and Party (Vice President) Voting Begins. a. System must prompt voters to enter voter's name and identification. b. System must be capable to record each vote for president and vice president. c. After each ballot a message must prompt the voter if vote has been successful or not Results a. Results must be displayed ONLY when the system has been successfully completed, in other words when the sentinel character has been entered. b. Output must display the winner President and Vice President with the number of votes that each candidate received. c. Output must also display which candidate was second, third, and so on (president and vice president) with total number of votes that each candidate received as well.

Explanation / Answer

First we create a class and enter party name and enter president and vice president name as per party

Note : we are not entering party and their candidate name in any database so that's why i used dictionary as it keep value in key , value pair

Key in dictionary will be party name and values will be president and vice president name

public class voting
{
public voting()
{
partyPresident = new Dictionary<string, string>();
partyVicePresident = new Dictionary<string, string>();
}
public string[] party = new string[] { "Democratic", "Republician", "Independent" };
public Dictionary<string, string> partyPresident { get; set; }
public Dictionary<string, string> partyVicePresident { get; set; }

public void displayInformation()
{
for (int i = 0; i < party.Length ; i++)
{
Console.WriteLine(party[i]);
Console.WriteLine("President : " + partyPresident[party[i]]);
Console.WriteLine(party[i]);
Console.WriteLine("VicePresident : " + partyVicePresident[party[i]]);
}

  
}

public void enterInformation()

{

Console.WriteLine("Enter your Name");

Console.Readline();

Console.WriteLine("Enter Your Voter Id");

Console.ReadLine();

}

public void beginVoting()
{
Console.WriteLine("Welcome to polling. Please select your favourite party president and vice president");
  

}

}
class Program
{
static void Main(string[] args)
{
voting v = new voting();
v.partyPresident.Add("Democratic", "A");
v.partyPresident.Add("Republician", "B");
v.partyPresident.Add("Independent", "C");
v.partyVicePresident.Add("Democratic", "D");
v.partyVicePresident.Add("Republician", "E");
v.partyVicePresident.Add("Independent", "F");
v.beginVoting();
v.displayInformation();

v.enterInformation();
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote