Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

program should be used by PTI Iecure program using the given temprite the coursework, and final exam marks should be able to do the following

image text in transcribed

image text in transcribed

image text in transcribed

program should be used by PTI Iecure program using the given temprite the coursework, and final exam marks should be able to do the following tasks: (Test2Q2.cpp). Your program should Task 1: Define a function named getinput. a) The purpose of this function is to get data from the keyboard for the nth student. b) It accepts an array of student IDs and an array of marks as input parameters. c) The user needs to enter the student ID, coursework, and final exam marks into the array received in (b) using the appropriate index. d) The function must then update the number of students, every time it is called. Hint: Static variable can be used for this purpose. e) The function should return the updated number of students calculated in (d). Task 2: Define a function named calcTotal. (4.5 marks) a) The purpose of this function is to compute the total mark for the nth student. b) It takes as input parameters an array of marks and an array index to represent the nth student. c) Calculate the total mark for the nth student by adding the coursework and final exam marks. d) This function should return the calculation result in (c). Task 3: Define a function named detergrade. (8 marks) a) The purpose of this function is to determine the grade for the nth student. b) It takes as input parameters an array of marks and an array index to represent the nth student. c) Determine the grade for the nth student using the total mark and the criteria listed in Table 2. d) This function should return the grade determined in (c). Table 2: Grading criteria Task 4: Define a function named displine. (2.5 marks) a) The purpose of this function is to display a line using the 42 characters of ' '. b) This is a non-returning function. Task 5: Define a function named dispoutput. a) The purpose of this function is to display output as shown in Figure 1. b) This is a non-returning function. c) It accepts as input parameters an array of student IDs, an array of marks, an array of grades, and the number of students. d) Determine the highest and lowest marks. e) Then, calculate the average of total marks. f) This function should display the student ID, coursework, final exam, total marks and grades of all students, the highest and lowest marks determined in (d), and the average total mark calculated in (e). You should invoke the function. Figure 1 shows an example of program output. Dind Task 6: Define a main function to perform the following tasks: a) Define three arrays: - A one-dimensional or two-dimensional array used to store a list of student IDs. - A two-dimensional array with three columns for storing a list of student marks. The first column contains the list of coursework marks, the second column contains the list of final exam marks, and the third column contains the total marks. - A one-dimensional array for storing a list of student grades. b) Use an appropriate LOOP to execute the process in this function. The loop will be repeated when the user press ' Y ' or ' y '. c) The function must call the functions defined in Tasks 1 until Task 3 and Task 5 to produce the output shown in Figure 1. The values in bold in Figure 1 are the user inputs. Task 7: You must ensure that your program meet the following criteria: a) The program is able to run and generate a correct output. b) Using an appropriate structure for the program: - All required header files are included. - The function main is properly written. Figure 1: Example output of the program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions