Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a function called GPA ) that calculates a student's overall and in-major grade point averages Function specification - Input argument: a struct with

image text in transcribedimage text in transcribed

1. Write a function called GPA ) that calculates a student's overall and in-major grade point averages Function specification - Input argument: a struct with the following fields . Name, a string, for example: "Albert Einstein" Grades, a column vector of letter grades, for example . NOTE: To simplify matters, we are not allowing or - grades. This enables converting from letters to quality points with a one-line logical expression. See the GPA function in Exercise 10 for some guidance Credits, a column vector containing the number of credits of each course, for example: [4; 3; 3;4; 5; 2;4; 4; 5; 2; 2; 3; 3; 4; 4] . . Major, a logical array, indicating whether each course is a major course, for example [true; true false; true; false; false; true; true; false; true; false; false; true; true; false] (or [1; 1; 0; 1; ..]) NOTE: Grades, Credits, and Major must have the same length Output argument: a 1x2 row vector containing the overall GPA and the in-major GPA Overall GPA Total Grades Total Credits Major GPA - Total Grades for Major Courses Total Credits for Major Courses An example call to this function could look like this student! = struct ("Name', '' John Doe'' , 'Grades', ['AABBABC"]', 'Credits', [4; 3; 4; 4; 5; 2; 3], 'Major',[true; true false: true false; true; false]) gpas GPA (student!); %gpas is a 1x2 vector fprintf('%s''s overall GPA is % .2 f, student1.Name, gpas (1), gpas (2)) and his in-major GPA is %.2f ', which results in this being printed to the command window 1. Write a function called GPA ) that calculates a student's overall and in-major grade point averages Function specification - Input argument: a struct with the following fields . Name, a string, for example: "Albert Einstein" Grades, a column vector of letter grades, for example . NOTE: To simplify matters, we are not allowing or - grades. This enables converting from letters to quality points with a one-line logical expression. See the GPA function in Exercise 10 for some guidance Credits, a column vector containing the number of credits of each course, for example: [4; 3; 3;4; 5; 2;4; 4; 5; 2; 2; 3; 3; 4; 4] . . Major, a logical array, indicating whether each course is a major course, for example [true; true false; true; false; false; true; true; false; true; false; false; true; true; false] (or [1; 1; 0; 1; ..]) NOTE: Grades, Credits, and Major must have the same length Output argument: a 1x2 row vector containing the overall GPA and the in-major GPA Overall GPA Total Grades Total Credits Major GPA - Total Grades for Major Courses Total Credits for Major Courses An example call to this function could look like this student! = struct ("Name', '' John Doe'' , 'Grades', ['AABBABC"]', 'Credits', [4; 3; 4; 4; 5; 2; 3], 'Major',[true; true false: true false; true; false]) gpas GPA (student!); %gpas is a 1x2 vector fprintf('%s''s overall GPA is % .2 f, student1.Name, gpas (1), gpas (2)) and his in-major GPA is %.2f ', which results in this being printed to the command window

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

=+ If strikes occur, are they legally regulated?

Answered: 1 week ago

Question

=+industrial action Under what circumstances can unions strike?

Answered: 1 week ago

Question

=+What forms of industrial action are common?

Answered: 1 week ago