Q.2 (a) As a teacher, it is quite a hassle to grade your students one by one according to the scores. Based on the flowchart in Figure Q.2 (a), write a MATLAB code to enter the name of your students with their scores into the system so that you can get the scores automatically. The system should print out the list of students' names with their score anc grade as shown in Figure Q.2(b). start 1=number of students nameli]=student i's name yes score[1]=student i's score i>0 H no print all end i=i-1 no 0<= score <=100 yes score >=90 yes gredi]='A' Student1 Student2 Student3 Student4 Student5 score >-80 yes gred='B' no Figure Q.2(a) Marks 92.00 84.00 76.00 65.00 45.00 score >=70 yes gred='C Figure Q.2(b) no Enter the number of students: 5 Student's name: Studentl Student's score: 92 Student's name: Student2 Student's score: 84 Student's name: Student3 Student's score: 76 Student's name: Student4 Student's score: 65 Student's name: Student5 Student's score: 103 Out of allowed range. Enter again: 45 Name Grade score >=60 Iyes gred='D A B C D F no Score >= 50 yes gred='E no gredi Write a function that takes a character as an input and prints out that symbol Function 'print'

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
(b)
Q.2
(a)
As a teacher, it is quite a hassle to grade your students one by one according to thei
scores. Based on the flowchart in Figure Q.2 (a), write a MATLAB code to enter the name
of your students with their scores into the system so that you can get the scores
automatically. The system should print out the list of students' names with their score and
grade as shown in Figure Q.2(b).
start
1=number of students
name[i]=student i's name
score[i] = student i's score
yes
i>0
I no
19
print all
end
i=i-1
no
0<= score
<=100
yes
score >=90
[yes
gred[i] = 'A'
no
score >-80
yes
gred='B'
Student1
Student2
Student3
Student4
Student5
Figure Q.2(a)
Student's score: 84
Student's name: Student3
no
Student's score: 76
Student's name: Student4
Student's score: 65
Student's name: Student5
Enter the number of students: 5
Student's name: Studentl
Student's score: 92
Student's name: Student2
score >=70
yes
gred='C
Marks
92.00
84.00
76.00
65.00
45.00
Figure Q.2(b)
no
Student's score: 103
Out of allowed range. Enter again: 45
Name
Grade
score >=60
yes
gred[i]='D
A
B
C
D
F
no
Score >= 50
yes
gred='E
no
gred=
Write a function that takes a character as an input and prints out that symbol
function 'print'
Transcribed Image Text:(b) Q.2 (a) As a teacher, it is quite a hassle to grade your students one by one according to thei scores. Based on the flowchart in Figure Q.2 (a), write a MATLAB code to enter the name of your students with their scores into the system so that you can get the scores automatically. The system should print out the list of students' names with their score and grade as shown in Figure Q.2(b). start 1=number of students name[i]=student i's name score[i] = student i's score yes i>0 I no 19 print all end i=i-1 no 0<= score <=100 yes score >=90 [yes gred[i] = 'A' no score >-80 yes gred='B' Student1 Student2 Student3 Student4 Student5 Figure Q.2(a) Student's score: 84 Student's name: Student3 no Student's score: 76 Student's name: Student4 Student's score: 65 Student's name: Student5 Enter the number of students: 5 Student's name: Studentl Student's score: 92 Student's name: Student2 score >=70 yes gred='C Marks 92.00 84.00 76.00 65.00 45.00 Figure Q.2(b) no Student's score: 103 Out of allowed range. Enter again: 45 Name Grade score >=60 yes gred[i]='D A B C D F no Score >= 50 yes gred='E no gred= Write a function that takes a character as an input and prints out that symbol function 'print'
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education