Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program to generate a course plan for a student which will enable him/her to graduate and satisfy all requirements. A course plan

Write a C program to generate a course plan for a student which will enable him/her to graduate and satisfy all requirements. A course plan is a list of courses which the student must take each quarter each year. In order to determine a course plan, your program will need 3 items of information which will be provided in three different files. The course plan will be printed by your program. Information Files The following three files contain information which is needed by your program to create a course plan. 1. Offering Information: Each course is offered once a year. The offering file describes the quarter in which each course is offered. Each line of the file contains two items separated by spaces. The first item on each line is the name of the class (which contains no spaces) and the second item on the line is the number of the quarter in which the course is offered. Assume that Fall is quarter number 1, Winter is quarter number 2, and Spring is quarter number 3. There are no summer courses. The following is an example of the contents of an offering file which describes that ICS 31, 32, and 33 are offered in Fall, Winter, and Spring, respectively. ICS31 1 ICS32 2 ICS33 3 2. Prerequisite Information: The prerequisite file describes the prerequisites of each course. Each line of the file describes the prerequisites of a single course. Each item on the line is the name of a course. All courses on the line, other than the first course, is a prerequisite for the first course on the line. The following is an example of a prerequisite file which describes that ICS 31 is a prerequisite of ICS 32, and that ICS 32 and Math 3A are prerequisites of ICS 33. ICS32 ICS31 ICS33 ICS32 MATH3A A course may have no prerequisites, in which case it will not be the first item on any line in the prerequisite file. 3. Requirement Information: The requirement file contains the list of courses that the student must take to graduate (not including their prerequisites). The requirement file contains a single line and each item on the line is the name of a course which the student must take in order to graduate. The following is an example of a requirement file which describes that CS 151, CS 161, and CS 171 must be taken to graduate. CS151 CS161 CS171

User Interface Your program will be invoked from the command line and it will accept three arguments on the command line, the names of the offering file, the prerequisite file, and the requirement file, in that order. The names of the three files are arbitrary, so your program should not assume any particular file names. Your program must create a course plan which describes the courses which a student should take each quarter in order to complete all of his/her graduation requirements. The course plan should be printed to the screen. Each line should list all of the courses which need to be taken in a single quarter. The first two items printed on each line should be the year number and the quarter number, respectively. The remaining items on a line should be the names of the courses which the student should take in that quarter. The quarters of the course plan should be printed in order based on the year number and the quarter number. The following is an example of how a course plan should be printed on the screen which describes a plan to take ICS 31 and Math 3A in the Fall of the first year, ICS 32 in the Winter of the first year, and ICS 33 in the Fall of the second year. 1 1 ICS31 MATH3A 1 2 ICS32 2 1 ICS33 Additional Notes The first year is year 1 and there is no limit on the total number of years that a student might require to graduate. There can be quarters when no class is scheduled in the course plan. Course names must contain no spaces. Each line in an information file must end with a character, except the last line which ends with an EOF character.

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

Step: 3

blur-text-image

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Solve the given equations. 2|x| 1 = 3

Answered: 1 week ago