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

Implement the solution using matlab, a. Develop and submit the simulation d...

a. Develop and submit the simulation described above. b. Provide a screen shot of the outputs of the DispConfig and MCResults functions. c. Notes: • Include the PPConfig f

Batch reactor, how to wriet program for batch reactor

how to wriet program for batch reactor

Salary calculation, write a matlab program to calculate employee salary.

write a matlab program to calculate employee salary.

Fourier series for the sawtooth wave, Q. An expression for a sawtooth wave ...

Q. An expression for a sawtooth wave over the internal 0 ≤ t ≤ T0 is given by f(t) = At/T0. The student is encouraged to check the Fourier coefficients to be a 0 = A/2, an = 0 for

DEVANAGANRI CHARACTER RECOGNITIO, RECOGNIZER and TRANSLATOR: i want to rec...

RECOGNIZER and TRANSLATOR: i want to recognized devanagari word using matlab. I have done it using template matching. but i am not get devanagari word at the output. But get speci

Matlab programming, Obtaining the Partial Fraction Expansion of the Z-Trans...

Obtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLAB

Variable number of output arguments - function, Variable number of output a...

Variable number of output arguments: The variable number of output arguments can also be identified. For illustration, the one input argument is passed to the below function t

Image processing, i am doing my project on matlab and the topic of my proje...

i am doing my project on matlab and the topic of my project is invisible watermarking.How we can extract all pixel values of image in binary form.

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