Earn Higher Grades With Instant Assignment Help.Ask Question!

C Programming
(5/5)

write a c program that will heavily use dynamic memory allocation and read data about the courses, sections, students, and scores of the students and will produce some summarized results from the data

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Introduction: For this assignment you have to write a c program that will heavily use dynamic memory allocation. Your solution should follow a set of requirements to get credit.

Compliance with Rules: UCF Golden rules apply towards this assignment and submission. Assignment rules mentioned in syllabus, are also applied in this submission. The TA and Instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed.

Caution!!!

Sharing this assignment description (fully or partly) as well as your code (fully or partly) to anyone/anywhere is a violation of the policy. I may report to office of student conduct and an investigation can easily trace the student who shared/posted it. Also, getting a part of code from anywhere will be considered as cheating.

What to do if you need clarification or need help?

Write an email to the TA and put the course teacher in the cc for clarification on the requirements. I will also create a discussion thread in webcourses and you can ask questions there too.

How to get help if you are stuck?

According to the course policy, all the helps should be taken during office hours. Occasionally, we might reply in email.

Problem

WOW training center offers certain number of courses. A course can have one or more sections. A section can have one or more students (assume that a student cannot enroll in multiple sections of the same course). A student has to do a certain number of assignments in the course. In order to pass the course, the average score of the assignment has to be

>=70.

You will write a program that will read data about the courses, sections, students, and scores of the students and will produce some summarized results from the data.

Input Specification (read data from a file in.txt. Do not use any other file name in your code.):

The first line of the file contains a single positive integer, t (t<=25), that represents the number of test cases to process. The test cases follow.

The first line of each test case contains a single positive integer, c (c<=500), that represents the number of courses. After that the file contains data for c number of courses.

The first line of a course contains a string, cn (all lower case, single word, max length <=20), that represents the course name.

The next line contains a single positive integer, s (s<=10), that represents the number of sections in the course cn. After that the file contains data for s number of sections for the course as follows.

The first line contains two positive integers, st (st<=500) and m (m<=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<=50,0000), a string lname (all lower case, single word, max length <=20), and m positive float numbers (each float number is <=100) separated by spaces, where id represents the id number of the student, lname represents the last name of the student, and m positive float numbers represent the score of the students in 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 (output should be in console. No need to write the output to a file):

For each course, display course name (in the same order they appear in the file), total number of students passed, 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 only 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 up to two decimal places) id lname avg_score (up to 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.

Sample in.txt

  • //number of test cases

  • //num of courses for test case1. The following lines are for test case 1

cs1 //name of course 1

  • //number of sections for course 1 (cs1)

  • 4 //no. of students and assignments for sec1 of course 1 (cs1)

101 john 70 60.5 95.2 50.6 //id lname scores 102 tyler 80 60.5 95.2 66.6

103 nusair 70 60.5 85.2 50.6

  • 3 //no. of students and assignments for sec2 of course 1 (cs1) 105 edward 90.5 60.5 2

104 alan 40 60.5 95.2

math2 //name of course 2

  • //number of sections for course 2 (math2)

2 2 //no. of students and assignments for sec1 of course 2 (math2)

101 john 95.2 53.6

103 nusair 86.2 56.6

  • 3 //no. of students and assignments for sec2 of course 2 (math2)

105 edward 90.5 60.5 98.2

104 alan 40 60.5 95.2

  • 2 //no. of students and assignments for sec3 of course 2 (math2)) 110 kyle 90.5 2

108 bob 45 85.2

109 smith 75.5 65.9 physics3 //name of course 3

1 //number of sections of course 3

4 2 //num of students and assignments for sec1 of course3 (physics3)

 

105 edward 60.5 98.2

104 alan 40.5 95.2

108 bob 55 85.2

109 smith 65.5 68.9

2//num of courses for test case2. The following lines are for test case2

cs1 //name of course 1

2 //number of sections for course 1 (CS1)

2 3 //no. of students and assignments for sec1 of course 1 (cs1) 102 habib 90.5 60.5 98.2

101 mohamed 40 60.5 95.2

4 3 //num of students and assignments for sec2 of course 1 (cs1) 104 manha 85.5 60.5 95.2

102 habib 80 60.5 95.2

103 hussain 70 60.5 85.2

109 ali 78.0 63.5 85.5

physics2 //name of course 2

3 //number of sections for course 2 (physics2)

2 2 //num of students and assignments for sec1 of course 2 (physics2)

101 mohamed 95.2 53.6

103 hussain 86.2 56.6

  • 3 //num of students and assignments for sec2 of course 2 (physics2)

105 aziz 90.5 60.5 98.2

104 manha 40 60.5 95.2

  • 2 //num of students and assignments for sec3 of course 2 (physics2)

110 ahmed 90.5 98.2

108 hasan 45 85.2 109 nadia 75.5 65.9

 

Sample Output

 

test case 1

cs1 2 70.41 74.15 105 edward 83.07

math2 5 72.90 74.15 76.72 110 kyle 94.35

physics3 2 71.12 105 edward 79.35

 

test case 2

cs1 5 74.15 76.38 102 habib 83.07

physics2 5 72.90 74.15 76.72 ahmed 94.35

Attachments:
(5/5)

Expert's Answer

41 Times Downloaded

Related Questions

Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

41 Times Downloads

Ask This Assignment To Be Done By Our ExpertsGet A+ Grade Solution Guaranteed

expert
joyComputer science
(4/5)
12 Answers Hire Me
expert
Robert DLaw
(4.8/5)
756 Answers Hire Me
expert
Dr Samuel BarberaStatistics
(5/5)
789 Answers Hire Me
expert
Tutor For YouEconomics
(5/5)
756 Answers Hire Me