フィルターのクリア

Program that outputs letter grade based on percentage?

2 ビュー (過去 30 日間)
Anne Nguyen
Anne Nguyen 2019 年 10 月 27 日
回答済み: Walter Roberson 2019 年 10 月 27 日
How do I create a script that has a program that takes in a student's score from an Excel Spreadsheet (in percent, i.e. 88%), and translate's (output) it to a letter grade? For example, if a student scores 90% on a test, then that is considered a A- since an A- is 90%-93%, and if a student scores 80%, then that is considered a B- since a B- is 77%-80%. In addition, the percentage at the boundary of each grade is assigned a high grade; for example, if a student’s grade percentage is 90%, the student receives ‘A-’, not ‘B+’ (A- is 90%-93% while B- is 87%-90%). The percent the student scored will be read from an Excel Spreadsheet (I don't know if that'll make a difference in the building of the code). Any help would be appreciated, thank you!

採用された回答

Walter Roberson
Walter Roberson 2019 年 10 月 27 日
if this_score >= 90 & this_score <= 93
this_grade = 'A-';
elseif this_score >= 77 & this_score <= 80
this_grade = 'B-';
else
this_grade = 'F';
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by