To be considered a FirstYear Student you need 029 credit hou
To be considered a First-Year Student, you need 0-29 credit hours. To be considered a Sophomore, you need 30-59 credit hours. To be considered a Junior, you need 60-89 credit hours. To be considered a Senior, you need 90 or more credit hours. Based on this classification system, ask the user to input the number of credits they have completed and using fprintf display the associated class standing formatted in a user-friendly manner.
Solution
main.m
clc;
close all;
clear all;
mycredits = input(\'Enter the number of credits:\');
if mycredits>=0 & mycredits<=29
fprintf(\'First year student\');
elseif mycredits>=30 & mycredits<=59
fprintf(\'Sophomore\');
elseif mycredits>=60 & mycredits<=89
fprintf(\'Junior\');
else
fprintf(\'Senior\');
end
Output:-
Enter the number of credits:29
First year student
Enter the number of credits:55
Sophomore
Enter the number of credits:88
Junior
Enter the number of credits:100
Senior
