In function display_marks(...): Using for-loop, display the name, total mark and grade from the array structure studentMark. • Count how many students obtained F. Based on the number of failure, calculate the failure rate percentage and display it

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
Question
DCP 5101 PROGRAM DESIGN
LAB 9
In function display_marks(...):
Using for-loop, display the name, total mark and grade from the array structure
studentMark.
Count how many students obtained F.
Based on the number of failure, calculate the failure rate percentage and display it.
SAMPLE OUTPUT:
STUDENT 1
Student Name
: Mat Dan
Midterm (15)
: 3.5
Assignment (15)
Quizzes (10)
Lab (10)
: 4
: 6
: 5.5
Final Exam (50)
: 21
STUDENT 2
Student Name
: Nancy Chi
Midterm (15)
12
Assignment (15)
Quizzes (10)
Lab (10)
11
: 6.5
: 8
Final Exam (50)
: 41.5
STUDENT 3
Student Name
: Kumar K.
Midterm (15)
15
Assignment (15)
Quizzes (10)
Lab (10)
: 10
: 9
: 10
Final Exam (50)
40.5
Student 1 Name
: Mat Dan
Total Mark
: 40.00
Grade
: F
: Nancy Chi
: 79.00
Student 2 Name
Total Mark
Grade
: B
Student 3 Name
: Kumar K.
Total Mark
: 84.50
Grade
: A
The failure rate is 33.33%
Transcribed Image Text:DCP 5101 PROGRAM DESIGN LAB 9 In function display_marks(...): Using for-loop, display the name, total mark and grade from the array structure studentMark. Count how many students obtained F. Based on the number of failure, calculate the failure rate percentage and display it. SAMPLE OUTPUT: STUDENT 1 Student Name : Mat Dan Midterm (15) : 3.5 Assignment (15) Quizzes (10) Lab (10) : 4 : 6 : 5.5 Final Exam (50) : 21 STUDENT 2 Student Name : Nancy Chi Midterm (15) 12 Assignment (15) Quizzes (10) Lab (10) 11 : 6.5 : 8 Final Exam (50) : 41.5 STUDENT 3 Student Name : Kumar K. Midterm (15) 15 Assignment (15) Quizzes (10) Lab (10) : 10 : 9 : 10 Final Exam (50) 40.5 Student 1 Name : Mat Dan Total Mark : 40.00 Grade : F : Nancy Chi : 79.00 Student 2 Name Total Mark Grade : B Student 3 Name : Kumar K. Total Mark : 84.50 Grade : A The failure rate is 33.33%
DCP 5101 PROGRAM DESIGN
LAB 9
QUESTION 3
Write a complete program to compute the grade of students based on their coursework and final marks.
Then, determine the overall failure rate. Refer to the sample output as your reference. The requirements
of the program are:
Declare a constant named numStudent which represents the number of students using #define
with the value 3.
Create a structure named as Marks which contains:
name
: character size 30
: float
: float
: float
: float
: float
: float
midterm
assignment
lab
quizzes
coursework
final exam
total mark
: float
grade
: character
Declare a structure array named studentMark with the size of numStudent.
In main() function:
Call function get_marks().
Call function compute_marks().
Call function compute_grade().
Call function display_marks().
In function get_marks():
Using a for-loop, prompt the user for the following inputs and store into array structure
studentMark: name, midterm, assignment, quizzes, lab, final exam.
In function compute_marks(..):
Using a for-loop, calculate the coursework and total marks of each student, then store the
results into array structure studentMark:
coursework = midterm + assignment + quizzes + lab
total mark = coursework + final exam
In function compute_grade(...):
Using if-else, determine grade based on the total mark, then store the grade accordingly
into array structure studentMark.
Total Mark
Grade
80 to 100
A
70 to < 80
В
50 to <70
C
O to < 50
F
Transcribed Image Text:DCP 5101 PROGRAM DESIGN LAB 9 QUESTION 3 Write a complete program to compute the grade of students based on their coursework and final marks. Then, determine the overall failure rate. Refer to the sample output as your reference. The requirements of the program are: Declare a constant named numStudent which represents the number of students using #define with the value 3. Create a structure named as Marks which contains: name : character size 30 : float : float : float : float : float : float midterm assignment lab quizzes coursework final exam total mark : float grade : character Declare a structure array named studentMark with the size of numStudent. In main() function: Call function get_marks(). Call function compute_marks(). Call function compute_grade(). Call function display_marks(). In function get_marks(): Using a for-loop, prompt the user for the following inputs and store into array structure studentMark: name, midterm, assignment, quizzes, lab, final exam. In function compute_marks(..): Using a for-loop, calculate the coursework and total marks of each student, then store the results into array structure studentMark: coursework = midterm + assignment + quizzes + lab total mark = coursework + final exam In function compute_grade(...): Using if-else, determine grade based on the total mark, then store the grade accordingly into array structure studentMark. Total Mark Grade 80 to 100 A 70 to < 80 В 50 to <70 C O to < 50 F
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
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