Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MATLAB function to solve the voting problem from HW4. The voting results shall be created as Sheet1 of an Excel file to be

Write a MATLAB function to solve the voting problem from HW4. The voting results shall be created as Sheet1 of an Excel file to be read by your MATLAB function. The function takes one argument which is the name of the Excel file. For 3.1.b, in addition to displaying on screen, your MATLAB function should also write the results on a new sheet of the same Excel file.

(hw4 )3.2 Programming with arrays in C (25 points) Deliverable: Code and screenshot of each run. The results from the mayors race have been reported by each precinct as follows: Precinct Candidate A Candidate B Candidate C Candidate D (1) 192 48 206 37( 2) 147 90 312 21 (3) 186 12 121 38( 4) 114 21 408 39( 5) 267 13 382 29 Write a program to do the following: a. Declare an array initialized with the number of votes from the above table. b. Compute and display the total number of votes received by each candidate and the percentage of the total votes cast. c. If any one candidate received over 50 percent of the votes, the program should display a message declaring that candidate the winner. ENEE 1530 Homework 4 Author: Ittiphong Leevongwat Page 6 of 6 d. If no candidate received 50 percent of the votes, the program should display a message declaring a runoff between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. e. Run the program once with the data shown and once with candidate C receiving only 108 votes in Precinct 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago