MATLAB Answers

calculate a grade of students

86 views (last 30 days)
matlab coder
matlab coder on 13 Jan 2021
Commented: matlab coder on 13 Jan 2021
%purpose is showing grades of 102 students and assign a letter grades
%the grades will be random numbers between 0 to 100
clc;clear;
student_numbers=20200001:20200102;
exam1=input('enter a value:');
exam2=input('enter a value:');
lab=input('enter a value:');
final_exam=input('enter a value:');
if final_exam>0 && final_exam<35
fprintf('your grade is FF');
elseif lab>0 && lab<10
fprintf('your grade is FF');
I want to develop a computer program which would calculate the total grade for each student. The weight of the each item for final grade calculation is; exam 1 25 %, exam 2 20%, lab 15% and final exam 40%. The final grades should be rounded to integers. After this, your program should specify the letter grade for each student. The rules for letter grade distribution are as follows:
1. Anybody whose final exam grade is less than 35 will automatically receive FF.
2. Anybody whose lab grade less than 10 will also automatically receive FF.
3. For the rest of the class excluding the people who failed at the first two steps, you would calculate the arithmetic average (mean) and standard deviation of the grades.
4. You will set CC grade to the mean grade you calculated in the previous step. Then you would add half the standard deviation to mean to set the starting point for the CB grade. Adding half the standard deviation once more would yield the starting point for the BB grade, etc… Following this procedure you would also calculate the starting points for the BA and AA grades.
5. For the grades lower than CC (DC, DD, FD and FF) you would successively subtract half of the standard deviation from the mean grade.
what should ı add up or change the code that ı write to make the program run. ı know its still on the first steps but ı get stuck and couldnt solve how to progress.. thank you in advance..

  0 Comments

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 13 Jan 2021
%purpose is showing grades of 102 students and assign a letter grades
%the grades will be random numbers between 0 to 100
clc;clear;
student_numbers=20200001:20200102;
% TODO: You're going to want to store these values in an array.
% You'll likely want to keep the people who failed the final or the lab as placeholders
exam1=input('enter a value:');
exam2=input('enter a value:');
lab=input('enter a value:');
final_exam=input('enter a value:');
if final_exam>0 && final_exam<35
% Step 1: Anybody whose final exam grade is less than 35 will automatically receive FF.
fprintf('your grade is FF');
elseif lab>0 && lab<10
% Step 2: Anybody whose lab grade less than 10 will also automatically receive FF.
fprintf('your grade is FF');
else
% Step 3: Calculate the arithmetic average (mean) and standard deviation of the grades.
% TODO: Fill in the array you created above.
end
% Step 4: Compute the bounds of each grade
% Step 5: For each student, determine their grade
If I interpret the question correctly, you're going to want to iterate through the 102 students and ask for their grades in turn. Steps 3, 4, and 5 sound like you'll need the data from all students to complete, so create an array to store the data. The NaN function may be of use in creating that array at the start of your code.
Do you know what functions exist in MATLAB to compute averages and standard deviation? If not, I recommend searching the documentation for some keywords (average and standard deviation seem like good first tries.) Open the documentation with:
doc

  1 Comment

matlab coder
matlab coder on 13 Jan 2021
ı know 'mean' and 'std' for average and standart deviation. but ı couldnt create a appropriate code. thanks for your response

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!