Question

Task 5 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following information: 1. 2, 3, 4, CoENG1060studentmarks (1) - Notepad File Edit Format View Help ID NUMBER 21245684 21245685 21245686 21245687 21245688 21245689use Matlab to solve this problem, thank you

0 1
Add a comment Improve this question Transcribed image text
Answer #1

Function:

function lfinal mark,grade] markscalc(lab, assignment, exam) final-mark round (0.2-lab + 0.1*a331gnment + 0.7*exam); it tinal

Script:

importdata (FILENAME, DELIM, NHEADERLINES) loads data from ASCII file FILENAME, reading numeric data starting from line NHEADCommand Window Enter Student ID 21245689 Final Marks : 73 , Grade -D

Command Window Enter Student ID : 213354568 Error using Marks txt read (line 15) ID not found

Command Window Enter Student ID 21245695 Final Marks 45, GradeF

TEXT:

Function :

function [final_mark,grade] = markscalc(lab,assignment,exam)

    final_mark = round(0.2*lab + 0.1*assignment + 0.7*exam);

    if final_mark >= 80
        grade = 'HD';
    elseif final_mark < 80 && final_mark >= 70
        grade = 'D';
    elseif final_mark < 70 && final_mark >=60
        grade = 'C';
    elseif final_mark < 60 && final_mark >= 50
        grade = 'P';
    else
        grade = 'F';
    end
end

Script :

% importdata(FILENAME, DELIM, NHEADERLINES) loads data from ASCII file
%    FILENAME, reading numeric data starting from line NHEADERLINES+1.

f = ("Marks.txt");                          % Filename
% data is tab delimited and it Contains one headerline
% Hence DELIM = "\t" and NHEADERLINES = 1
all_marks_data = importdata(f,"\t",1);      % extracting data skipping first line
% all_marks_data is a struct containing text fields and numeric data
% hence extracting only numeric data in marks which is stored in data field
marks = all_marks_data.data;

ID = input("\nEnter Student ID : ");
row = find(marks == ID);
if isempty(row)
    error("ID not found")                  % Some error proofing
end
student_marks = marks(row,:);              % Getting data for entered Student ID
lab = sum(student_marks(2:11));            % Extracting lab marks(column 2:11)
assignment = student_marks(12);            % Extracting assignment marks(column 12)
exam = student_marks(13);                  % exam marks (column 13)
[final_mark,grade] = markscalc(lab,assignment,exam);    % Using developed function
fprintf("\n Final Marks : %d , Grade = %s\n",final_mark,grade);   % Printing results
Add a comment
Know the answer?
Add Answer to:
Task 5 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Matlab question Task 2 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following...

    Matlab question Task 2 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following information: 1. Column 1: Student ID 2. Column 2--11: Lab marks (/10) worth 2% each (20% total of final grade) 3. Column 12: Assignment mark (/10) worth 10% of the final grade 4. Column 13: Exam mark (100) worth 70% of the final grade a) Write a function that accepts a student's laboratory, assignment and exam marks as inputs to determine the final mark...

  • Write a grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

  • PYTHON 3 Object Oriented Programming ***a9q3.py file below*** class GradeItem(object): # A Grade Item is anything...

    PYTHON 3 Object Oriented Programming ***a9q3.py file below*** class GradeItem(object): # A Grade Item is anything a course uses in a grading scheme, # like a test or an assignment. It has a score, which is assessed by # an instructor, and a maximum value, set by the instructor, and a weight, # which defines how much the item counts towards a final grade. def __init__(self, weight, scored=None, out_of=None): """ Purpose: Initialize the GradeItem object. Preconditions: :param weight: the weight...

  • Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might...

    Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might be worth 40% of your final grade. To calculate the grade for the Assignments category, the teacher takes the percentage earned on the assignments and multiplies it by the weight. So if the student earned a 90% total on the Assignments, the teacher would take 90% x 40, which means the student earned a 36 percent on the Assignments section. The teacher then calculates...

  • Task description You are given a student result data file (result.csv). It has columns ID: studen...

    Please include screenshot of coding and program running - Python. Thanks in advance!! Task description You are given a student result data file (result.csv). It has columns ID: student id Assi ~ Ass4: assignment scores (out of 100); weight of assi, ass2, ass and ass4 is 5%, 15%, 5%, and 15%, respectively Exam: examination score (out of 120); weight is 60%. Hurdle is 40% of exam total (48) Total: weighted total result (5%" (ass1+ass3) + 15%" (ass2+ass4) + 60%"exam) ID...

  • Question 5.[15 marks] [Chapters 7 and 8] Data from a random sample of a recent large second semester stage 2 statistics course (STATS 20x) were collected. Below is some information on the variabl...

    Question 5.[15 marks] [Chapters 7 and 8] Data from a random sample of a recent large second semester stage 2 statistics course (STATS 20x) were collected. Below is some information on the variables collected. Variable Grade The student's final grade for the course: A, B. C, D Pass Whether the student passed the course: Yes, No Programme The programme the student is enrolled in: BA, BCom BSc, Other Sex The student's sex: Female, Male ผhether the student regularly attended class:...

  • Task 4 Download the temperatures.txt file from Moodle. The file contains temperature data which h...

    Use the Matlab to solve this one, please! Task 4 Download the temperatures.txt file from Moodle. The file contains temperature data which has beern collected once a day and contains noisy data. Write a MATLAB m-file that performs the following: Read the temperature values from temperatures.txt into a vector A. B. C. Plot the temperature against time using red diamond markers. Without using loops, remove the noisy data using the following rules: I Any temperature value above 45°C is invalid...

  • A continuation of your grading software will be made (you do not need your other code...

    A continuation of your grading software will be made (you do not need your other code for this assignment). In this one you will intake a students first name and last name from a file called "students.txt". Next, there is a file called grades.txt that contains the grades in a course. There will be three grades for each student in "grades.txt" (see example file bellow). In "student.txt" there are two students first and last names. In "grades.txt" the grades for...

  • program to calculate the final mark of every student from data file

    hello there I was given task to read and calculate final mark of students with 68 rows (no name for the student )with 8 column(T1,T2,T3,HW1,HW2,HW3,HW4,PRJ) from a DAT. file.I managed to read the file but stuck on how to calculate final mark of the student and the final mark column should be at the 9th column when the programs displays.the following are  the sample data of student:T1  T2  T3  HW1 HW2 HW3 HW4  PRJ 55   56  70   5      6       7       ...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT