using System; using System.Collections.Generic; namespace ConsoleApp3 { class Program { List lstCand = new List(); static void Main(string[] args) { Console.WriteLine("Hello World!"); string[] arrName...






using System; using System.Collections.Generic; namespace ConsoleApp3 { class Program { List lstCand = new List(); static void Main(string[] args) { Console.WriteLine("Hello World!"); string[] arrName = new string[3] { "Smith", "Jones", "Roberts" }; string[] arrParty = new string[3] { "D", "R", "N" }; int[] arrTotalVotes = new int[3]; Program p = new Program(); p.LoadCandidate(arrName, arrParty); Boolean cont = true; while (cont) { Console.WriteLine("Enter a number to vote for a candidate."); for (int i = 0; i < arrname.length;="" i++)="" {="" console.writeline("type="" "="" +="" (i="" +="" 1)="" +="" "="" for="" candidate="" "="" +="" arrname[i]);="" }="" string="" input="Console.ReadLine();" try="" {="" int="" n="Convert.ToInt32(input);" if="" (n="">< 1="" &&="" n=""> arrName.Length) { Console.WriteLine("Please enter a valid selection."); continue; } else//valid { arrTotalVotes[n - 1]++; Console.WriteLine("Continue?1 for Exit.Any key for continue"); string con = Console.ReadLine(); try { int choice = Convert.ToInt32(con); if (choice == 1) cont = false; } catch (Exception) { continue; } } } catch (Exception) { Console.WriteLine("Please enter a valid selection."); continue; } } for (int i = 0; i < arrname.length;="" i++)="" {="" console.writeline("candidate="" "="" +="" arrname[i]="" +="" "="" total="" votes:"="" +="" arrtotalvotes[i]);="" }="" console.readkey();="" }="" public="" int="" loadcandidate(string[]="" arrname,="" string[]="" arrparty)="" {="" int="" maxcan="arrName.Length"> 10 ? 10 : arrName.Length; //Max 10 Candidate for (int i = 0; i < arrname.length;="" i++)="" {="" candidate="" can="new" candidate()="" {="" name="arrName[i]," partycode="arrParty[i]" };="" lstcand.add(can);="" }="" return="" lstcand.count;="" }="" }="" public="" class="" candidate="" {="" public="" string="" name="" {="" get;="" set;="" }="" public="" string="" partycode="" {="" get;="" set;="" }="" public="" int="" votes="" {="" get;="" set;="" }="" }="">


What I need is to convert this code to Flowgorithm.







Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here