Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To create an m - file in Matlab you should implement the following steps: Introduce the grades in a matrix format. Create a matrix with

To create an m-file in Matlab you should implement the following steps:
Introduce the grades in a matrix format. Create a matrix with first column being the
course number (this column is just for your reference and will not be actually used for
calculations), a second column for the number of credits of that course, and a third
column for the grade. The easiest way would be to introduce the numerical equivalent of
the grade (4 for an A,3.7 for A-,3.3 for B+,3 for a B,2.7 for B-, and so on). For
example for ENGT305 course if your grade is A-, the corresponding row in matrix A
will be [30533.7].
Using a for loop, go through all the courses in your matrix (in other words through all
the lines on the matrix) and calculate a weighted sum of the grades. In the same time,
you should also keep track of the total number of credits added.
Your final GPA will be the weighted sum divided by the total number of credits.
You may test your code with your own grades from DegreeWorks if you want, but for the
exam you should just introduce some random example, with at least 5 courses in the initial
matrix.
b) Once a GPA is calculated, add commands to read a new course grade and calculate
what correction the new grade will produce. (You do not need to redo all the calculations
with all the grades, you need to use the GPA already calculated and do a correction to it
based on the new grade added.) To test this part check what increase a new course of 3
credits with a grade of A will produce and what penalty a grade of F will produce.
image text in transcribed

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

More Books

Students also viewed these Databases questions