I need help with grade calculator! thank you!!
Mostra commenti meno recenti
Afternoon Matlab Users,
Hope you're all having the best of days!
This is part of my class homework - I'm trying to make a grade calculator.
where there's a 'Edit Text' user input where 'Number' grade is calculated when pressed the assigned 'Push button'
and another 'Edit Text' where I want display the 'Letter' grade in accordance to the number grade above also via 'Push Button'
Below is my coding:
% --- Executes on button press in enter11.
function enter11_Callback(hObject, eventdata, handles)
if (handles.out19 >70 && <=100)
disp('You achieved a 1st');
elseif (handles.out19 >60 && <=69)
disp('You achieved 2:1');
elseif(handles.out19 >50 && <=59)
disp('You achieved 2:2');
elseif(handles.out19 >40 && <=49)
disp('You achieved 3rd');
elseif(handles.out19 >0 && <=39)
display('You failed');
end
and below is the defined error:
Error while evaluating UIControl Callback.
Relating to this, I also want to display the 'Letter grade' on a Panel.
But i'm struggling!
Help would be appreicated.
1 Commento
Adam Danz
il 23 Mar 2020
Copied here in case the question is edited/deleted as in a previous thead by OP.
----------------------------------------------------------------------------------------------------------
Afternoon Matlab Users,
Hope you're all having the best of days!
This is part of my class homework - I'm trying to make a grade calculator.
where there's a 'Edit Text' user input where 'Number' grade is calculated when pressed the assigned 'Push button'
and another 'Edit Text' where I want display the 'Letter' grade in accordance to the number grade above also via 'Push Button'
Below is my coding:
% --- Executes on button press in enter11.
function enter11_Callback(hObject, eventdata, handles)
if (handles.out19 >70 && <=100)
disp('You achieved a 1st');
elseif (handles.out19 >60 && <=69)
disp('You achieved 2:1');
elseif(handles.out19 >50 && <=59)
disp('You achieved 2:2');
elseif(handles.out19 >40 && <=49)
disp('You achieved 3rd');
elseif(handles.out19 >0 && <=39)
display('You failed');
end
and below is the defined error:
Error while evaluating UIControl Callback.
Relating to this, I also want to display the 'Letter grade' on a Panel.
But i'm struggling!
Help would be appreicated.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
