Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

First, create a step-by-step algorithm (or a graphical flowchart) to determine a

ID: 3728037 • Letter: F

Question

First, create a step-by-step algorithm (or a graphical flowchart) to determine and display a student’s letter grade in a course. A course grade is typically reported as a real number with values from 0 to 100. Your algorithm should ask the user to provide a grade in numerical form and display the letter grade corresponding to the numerical grade if the entered value is between 0 and 100 inclusive. If the value is outside of this range, ask the user to re-run the program and enter a value within the range of 0-100. Typical ranges for grades are given below: A: 90 grade B: 80 grade < 90 C: 70 grade < 80 D: 60 grade < 70 F: grade < 60

Then, write a MATLAB script that implements your algorithm/flowchart. The program should ask the user for his or her numeric grade and the letter grade should be generated as the output. Specifically, the computer must display the following message:
You entered a score of <numerical grade specified by user>. Your letter grade is <letter grade calculated by algorithm>. At the location given by <numerical grade specified by user>, the program must display the numerical grade that the user just entered, and at the location given by <letter grade calculated by algorithm>, the program must display the letter grade that it calculated based on the user’s input. Therefore, if the user entered a score of 74, the message must show: You earned a score of 74. Your letter grade is B. Similarly, if the user entered a grade of 56, the message must show: You earned a grade of 56. Your letter grade is F.

Explanation / Answer

ScreenShot

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

Script:-

%prompt user to enter their score
grade=input("Enter numeric grade = ");
%check the entered grade between 0 -100(inclusive)
if grade>=0 && grade<=100
%display corresponding letter grade using if condition
if 90<=grade
fprintf('Your Earned Score is %s.',num2str(grade))
disp('Your Letter Score is A.')
elseif 80<=grade && 90>grade
fprintf('Your Earned Score is %s.',num2str(grade))
disp('Your Letter Score is B.')
elseif 70<=grade && 80>grade
fprintf('Your Earned Score is %s.',num2str(grade))
disp('Your Letter Score is C.')
elseif 60<=grade && 70>grade
fprintf('Your Earned Score is %s.',num2str(grade))
disp('Your Letter Score is D.')
else
fprintf('Your Earned Score is %s.',num2str(grade))
disp('Your Letter Score is F.')
end
%user entered grade not in between 0-100(inclusive) the ask user to re-run the program
else
disp('Re-run your program ')
end

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

Algorithm:-

def letter_grade(grade):

    if 0<= grade <=100:

    if grade >= 90: return "A"

    if 80 <= score <90: return "B"

    if 70 <= score <80: return "C"

    if 60 <= score <70: return "D"

    if 60 > score: return "F"

    If 0>grade>100: re_run

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

Note:-

I am using Octave online editor.

If any queries,let me know