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

Grading System: Overall grade is based on the standard grading scale: 90%=A, 80%

ID: 3681415 • Letter: G

Question

Grading System: Overall grade is based on the standard grading scale: 90%=A, 80%=B, 70%=C, 60%=D, <60%=F Structure/ Approach: Assessment is based on four criteria categories: Homework, Projects, In-class Activities 30% Reading Quizzes 20% Mid-term Exams (2) 30% Final Exam 20% Total 100%

What are the four assessment categories and their respective weights?

Using the Top-Down Design Process (Chapter 4.1):

State the problem that you are trying to solve

Determine the requirements (input/output) to solve the problem

Develop an algorithm for calculating an overall grade in CS122

Convert the algorithm to MATLAB syntax

Test your program

Getting Started With MATLAB

At the MATLAB menu, enter File à New script, to type the commands below. Enter File à Save As to save this program. Give the script a descriptive name. Make sure to file it in a directory where you can find it later!

The sample MATLAB syntax below will prompt a user to enter grades (in matrix form) for the Homework category, and calculates the total weighted percent of homework for the class.

For example, if there are 3 homework grades (11/15, 12/15, 14/15) – they would be entered in this form: [11 12 14; 15 15 15]

% Homework grade (consists of homework, projects, in-class exercises)

hw = 0;

hw_weight = 0.30;

hw = input('Enter a grade matrix for homework (row1 = earned points, row2 = possible points): ');

total_hw = sum(hw,2);

hw_percent = total_hw(1) ./ total_hw(2);

total_weighted_hw = hw_percent * hw_weight;

disp(total_weighted_hw);

Take the time to learn to learn how the MATLAB code above actually works, and apply similar logic to calculate grades for each assessment category. Then sum the grades for each category to calculate the overall grade, and use this as the main output from the program.

Use comments in your to illustrate your new-found knowledge. All text after the percent (%) sign on the same line is taken as comment --- MATLAB simply ignores anything to the right of this sign.

To test your program, enter at least one grade for each assessment category (do not use your own grades!) and check the overall grade result for correctness. Document your result by copying/pasting your results into your Project Report (Word document).

Project Report

The final step of this assignment is to create a Project Report (Word document) in the format discussed in the CS122L Lab Submission Guidelines.

The Project Report should contain the following information:

Purpose
Describe the purpose of your program.

Approach
Describe your approach to completing this project.

Methods

Mathematical processes and calculations followed.

Implementation

Results and “m” file(s) of your code.

Conclusions

Describe any significant problems or challenges you encountered and how you solved them.

Explanation / Answer

%-----
function checkprime = primality(n)
n = input('Enter value of n: ');
m = 2; % initialise factor to test
t=floor(sqrt(n));count=0;
for m = 2:t
if mod(n,m) == 0 %m is a factor of n
disp('n is not prime')
primalitytest=0;
else
count=count+1;
end
end;
if count==t-1
disp(' n is prime');
primalitytest=1;
end
%-------