CS 1371 HW, MATLAB Programming

Assignment Help:
Function Name: voteCounter

Inputs (1): - (char) filename of votes

Outputs (0): - none

Function Description:

You use the brand new VoteMaster 3000 to tally up votes in the recent

elections of some of your extracurricular organizations. To your dismay,

it only outputs a txt file with a title describing the election and a

list of the candidates'' names, with each line representing a vote for

that candidate.

In addition to suing the VoteMaster 3000 makers for false advertising,

you now have to create a MATLAB function named voteCounter that takes in

the txt file of names and writes another txt file containing the

candidates and their respective votes, in descending order. Furthermore,

the filename of the written txt file should be the first line of the

input txt file.

For example, if the input txt file contained

1371 Head TA Elections

McGraw

Carter

Tahler

Bragg

Carter

your written txt file should be named ''1371 Head TA Elections.txt'' and contain

Carter 2

McGraw 1

Tahler 1

Bragg 1

Notes:

- in the written text file, there is a space between the candidate name

and his/her number of votes

- in the event of a tie, the candidate who appears first in the input

file wins (the sort function should take care of this)

- there should be no empty line at the end of your written file (i.e. the

last line of your written file should be the candidate who received the

least number of votes)

- PLEASE open the txt files in MATLAB to avoid confusion with new lines.

Related Discussions:- CS 1371 HW

Illustration of script, Illustration of script: For illustration, we w...

Illustration of script: For illustration, we will now generate a script known as script1.m which calculates area of the circle. It assigns a value for the radius, and then com

Gaussian elimination, Diary Files: Before doing this assignment, please rea...

Diary Files: Before doing this assignment, please read the document Notes on Matlab Assignments (available from the course web page). It describes how to record the results of your

Batch reactor, how to wriet program for batch reactor

how to wriet program for batch reactor

Matlab script that will prompt the user to enter the launch , Consider the ...

Consider the analytic solution of the projectile problem described. Write a MATLAB script that will prompt the user to enter the launch speed and angle, and will compute the peak h

Introduction to matlab, Introduction to Matlab: The MATLAB is a graphi...

Introduction to Matlab: The MATLAB is a graphical and mathematical software package; it has graphical, numerical and programming capabilities. It has built-in functions to do

First order differential equations, First order differential equations: Eul...

First order differential equations: Euler's method Finally, we consider ?nding the numerical solution for a ?rst order differential equation given an initial value. We consider

Scripts to produce and customize the simple plots, Scripts to Produce and C...

Scripts to Produce and Customize the Simple Plots: The MATLAB has many graphing capabilities. In most cases, customizing plots are desired and this is the simplest to accompli

Create matlab program, Create MATLAB program(s) that solve a problem of you...

Create MATLAB program(s) that solve a problem of your own choice. You may opt to solve work related problem, an industrial problem, or problem from your research project. Markin

Illustration of variable number of input arguments, Illustration of Variabl...

Illustration of Variable number of input arguments: In this situation, it was supposed that the radius will always be passed to the function. The function header can hence be

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd