Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING MATLAB: 2. Given a file containing test scores, one per line, we want to have a new file that contains the scores in increasing

USING MATLAB:image text in transcribed

2. Given a file containing test scores, one per line, we want to have a new file that contains the scores in increasing order. To do this, write a MATLAB script (hw5b.m) that asks the user for two file name strings, one for the input scores and the second for the output, sorted scores. The program should open the first file (to read), read the scores, sort them, open the second file (to write), and output to this file the scores in increasing order. There should be one score per line, with their line number from the input file. As an example, suppose the input file is scores.txt and it contains 75 98 75 100 21 83 15 then running your program should look like the following: Enter the scores file: scores.txt scores.txt Enter the output file: scores_sorted.txt scores sorted.txt When you look at the contents of scores_sorted.txt you should see 8: 15 5: 21 6: 66 1: 75 3: 75 7: 83 2: 98 4: 100

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

Students also viewed these Databases questions

Question

What is Top - Down Network Design?

Answered: 1 week ago

Question

=+2 Why are international employment standards important to IHRM?

Answered: 1 week ago

Question

=+1 Why are local employment laws important to IHRM?

Answered: 1 week ago