Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, please write the following MATLAB program to the respected specifications. I just wish to check my work, I would not think to just copy

Hi, please write the following MATLAB program to the respected specifications. I just wish to check my work, I would not think to just copy and paste a answer. I have a few bugs in my program and was hoping an answer will allow me to resolve them. First, read the assignment. Then, look at the format that my program is written in given the following pseudocode. Thank you.

------------

OVERVIEW: You are teaching one large class, or several smaller classes. You want to make your grade computations as easy as possible! Therefore, you write a function to compute student grades. The m-file you submit should be a FUNCTION, where its input is a 2-D array where each row represents a list of grades for a student. For example, if the array is size m n then there are m students, each with n grades. Your function will have two outputs: an m 1 array of sorted student averages and the value of the overall class average. Within your submitted function, you will have TWO subfunctions - one of the subfunctions you write, the other we wrote in class. In particular, since this program is a function, note that you will not have any input statements this time. Your m-file will have the following structure:

image text in transcribed

% Note that GRADES is a 2D array of grades of arbitrary length lllc13l9lllllelll9999991l function [sorted-avgs , class-avg] = thelwerj_hx3 (GRADES); % (You don't have to type this part - this comment block % is to be replaced by your code % This function is to perform the following tasks: % 1 . For each student, drop the two lowest scores % 2. For each student, compute their grade average (assuming the 2 lowest scores have been dropped). Store a sorted list of student averages in an mx1 array "sorted_avgs". % 3. Compute the overall class average (i.e., the average of all the students, averages). This value should be stored in the scalar variable "class_avg". % 4. (optional, but +1 bonus point). Assign letter grades for each student! Use the standard 10-point scale. You will need to use character variables/strings for the grades. If you assign letter grades, then you should print the sorted list of averages and the corresponding letter grades to the screen. % SUBFUNCTION: Bubble Sort % Purpose: Given a list of numbers, this subfunction returns a sorted list function x-bubblesort (x); % Rewrite the bubblesort program in class using arrays. This should be % very short! I wrote this in about 5 lines of code. Do not spend % more than one evening doing this part. If you are spending longer, see me soon. % SUBFUNCTION: order % Purpose: Given two numbers, this subfunction sorts the numbers % NOTE: we did this function in class! It's also in the text (Chp 5) function [a,b]-order(a,b); if (b>a) temp-a; a-b b-temp; end

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

How do the Big Five traits predict behavior at work?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago