Answered step by step
Verified Expert Solution
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 mfile 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 for an A for A for B for a B for B and so on For
example for ENGT course if your grade is A the corresponding row in matrix A
will be
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 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
credits with a grade of A will produce and what penalty a grade of F will produce.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started