Write the following program: Use struct data type to store information about courses. Every course is characterized by the following information: 1) Title (up to 20 characters); 2) Number of credits (integer); 3) Instructor (up to 15 characters); and 4) the suggested order of the course in the course sequence of the major (integer; Two courses can have the same suggested order). - The information about individual courses is read from an input file.
- Store the information about all courses in an array and then display the content of the array.
- Order the courses in the alphabetical order of their titles and then display all the courses.
- Order the courses in the suggested order of the courses, such that one course with a lower suggested order is always before a course with a higher suggested order. Assuming that a student cannot take more than X credits per year (the value X is read from the keyboard), display what courses a student should take every year, so that courses are following the suggested order and the number of credits per year does not exceed the limit X.
Note: Extra credit is given if dynamic data structures are used.
example:
Inputfile: ESE999 5 Marshmello 2
MAT123 3 David 1
CSE123 4 Armin 3
JPN123 1 Martin 3
AMS123 2 Dimitri 1
Output:(display the content of the array):
ESE999 5 Marshmello 2
MAT123 3 David 1
CSE123 4 Armin 3
JPN123 1 Martin 3
AMS123 2 Dimitri 1
Output:(Order the courses in the alphabetical order of their titles and then display all the courses.)
AMS123 2 Dimitri 1
CSE123 4 Armin 3
ESE999 5 Marshmello 2
JPN123 1 Martin 3
MAT123 3 David 1
(Order the courses in the suggested order of the courses):
Input: 6
Output:
Year 1:
AMS123 2 Dimitri 1
MAT123 3 David 1
Year 2:
ESE999 5 Marshmello 2
JPN123 1 Martin 3
Year 3:
CSE123 4 Armin 3

Solved
Show answers

Ask an AI advisor a question