subject
Computers and Technology, 10.06.2021 18:10 mat1413

For each section: The first line contains two positive integers, st (st s 500) and m (m s 20), where st represents the number of students in the section and m represents the number of assignments in the section. The following st number of lines represents data for the st number of students (each line for each student). A student data line contains a positive integer, id (id s 500,000), a string Iname (all lower case letters, max length s 20), and m positive floating point numbers (each number is s 100.0) separated by spaces, where id represents the id number of the student, Iname represents the last name of the student, and the m positive floating pointing numbers represent the scores of the student on the m assignments for the course. Assume that the id numbers are unique for each student. Similarly, the file contains data for s number sections for the course cn. Similarly, the file contains data for all the courses for each test case. Output (to standard output): For each test case, output a single line header with the following format: test case x where x is the test case number, starting with one. Within each test case, produce a single line of output for each course. For each course, display the course name (in the same order they appear in the file), total number of students who passed the course, the average scores for each section of the course in the same order they appear in the file), id, last name and average score of the student who achieved highest average score in the assignments of the entire course regardless of section (print the first student, in terms of where they appear in the file, if multiple students achieved the highest score). Display the result in one course per line in the following format: course_name pass_count list_of_averages_section(separated by space rounded to exactly two decimal places) id lname avg_score (rounded to exactly two decimal places) Where course_name is the name of the course, pass_count is the total number of students passed the course, list_of_averages_section is the list of average scores per section of the course, id, lname and avg_score is the id, last name, and average score of the student who achieved the highest score in the course. A partial view of the memory map of the arrays will be like the following figure. Courses is an array of course. Sections of a course is an array of arrays of students (a. k.a 2D array of students). sections [0] sections [1] student [0] 1/st=num_students(0) Student [st-1] Courses [0] scores (0) scoresto] scores (0) scores [0] Courses [1] sections (num sections-1] scores (m- 1] scores (m-1) scores (m-1) scores (m-1) Courses [21 //m=num_scores[0] Array of students like above Courses (C-1) sections (0) sections (1) student (0) Student Ist- scores01 scores (0) score101 scores (01 sectionsnum sections-1] scores (n-1) scores (n-1) scores (n-1) //m=num_scores[0] scores (m-1) 2. You have to use dynamic memory allocation for the arrays and strings based on the size and data you will receive from the file. 3. After processing the job of a test case, you must have to free memory appropriately. 4. Your code should implement at least the following functions: a. course" read_courses (int *num_courses): This function takes the reference of an integer to track how may courses the file has. Then it reads the data for an entire test case and return the allocated memory for all the courses (including sections) for a test case. Note that you can call other functions from this function as needed.
b. student** read_sections(int num_students[], int num_scores[], int num_sections): This function takes the references of two arrays, one for number of students, and one for number of scores for a course, as well as the number of sections, which is the length of both arrays. The function reads all the data for all the sections of a course, fills up the num_students and num_scores array of the course and returns a 2D array of students that contains all the data for all the sections of a course. A good idea would be calling this function from the read_course function.
c. void process_courses (course "courses, int num_courses): This function takes the array of courses produced and filled by all the courses of a test case and the size of the array. It displays the required data in the same format discussed in the sample output. You can write and use more functions in this process as you wish.
d. void release_courses ( course *courses, int num_courses): This function takes the array of courses produced and filled by all the courses of a test case and also takes the size of the array. It frees up all the memory allocated within it. You can create more function as needed to ease the process.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 24.06.2019 17:50
You will subnet the network address 172.31.103.0/24. the network has the following requirements: · room-114 lan will require 27 host ip addresses · room-279 lan will require 25 host ip addresses · room-312 lan will require 14 host ip addresses · room-407 lan will require 8 host ip addresses how many subnets are needed in the network topology?
Answers: 2
question
Computers and Technology, 24.06.2019 18:20
7. design a circuit with three inputs (x, y, and z) representing the bits in a binary number, and three outputs (a, b, and c) also representing bits in a binary number. when the input is 1, 2, or 3, the binary output should be one lesser than the input. when the input is 4, 5, or 6, the binary output should be one greater than the input. when the input is 0, the output is 0, and when the input is 7, the output is 7. show your truth table, all computations for simplification, and the final circuit.
Answers: 2
question
Computers and Technology, 25.06.2019 01:20
Jason typically uses the internet to buy various items. it the total cost of all of the items ordered, at one time, is $250 or more, then the shipping and handling is free, otherwise the shipping and handling is $15 per item. design an algorithm that prompts jason to enter the number of items ordered and the price of each item. (remember cost = number of items order times price) the algorithm then outputs the total billing amount including shipping and handling. your algorithm must use a loop (repetition structure) to get the number and price of each item. write this in algorithm format not program code format.
Answers: 2
You know the right answer?
For each section: The first line contains two positive integers, st (st s 500) and m (m s 20), where...
Questions
question
History, 30.12.2019 12:31
question
Mathematics, 30.12.2019 12:31
question
Geography, 30.12.2019 12:31
Questions on the website: 13722363