Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Files will be stored inside a directory called data within the same directory as your script. 2 . Each file will be named
Files will be stored inside a directory called data within the same directory as your script.
Each file will be named based on the combination of a department code and a course number,
which consists of two or three letters followed by an integer with exactly four digits, followed by
the extension crs
A course file consists of exactly these lines:
deptcode two or three letter abbreviation deptname string with probable whitespace
coursename string with probable whitespace
coursesched string consisting precisely of either MWF or TH coursestart string
with no whitespace courseend string with no whitespace coursehours credit hours,
unsigned integer coursesize enrolled students, unsigned integer
Department names may contain whitespace. You should account for names with multiple tokens
egESL English as a Second Language deptcode ESL and deptname English
as a Second Language
Example file named eslcrs
ESL English as a Second Language
Literacy in a Second Language
MWF
Script Execution
When the script is run, the following should occur. All script output should appear exactly as it
appears below.
Upon running your script, the user should be presented with the following menu:
Enter one of the following actions or press CTRLD to exit.
C create a new course record
R read an existing course record
U update an existing course record
D delete an existing course record
E update enrolled student count of existing course
T show total course count
The user then enters a onecharacter action upper or lowercase leading to one of the following.
C: a course is created
a From the terminal, read the following one at a time:
i Department code twotothree character string
ii Department name string possibly containing whitespace Files will be stored inside a directory called data within the same directory as your script.
Each file will be named based on the combination of a department code and a course number,
which consists of two or three letters followed by an integer with exactly four digits, followed by
the extension crs
A course file consists of exactly these lines:
deptcode two or three letter abbreviation deptname string with probable whitespace
coursename string with probable whitespace
coursesched string consisting precisely of either MWF or TH coursestart string
with no whitespace courseend string with no whitespace coursehours credit hours,
unsigned integer coursesize enrolled students, unsigned integer
Department names may contain whitespace. You should account for names with multiple tokens
egESL English as a Second Language deptcode ESL and deptname English
as a Second Language
Example file named eslcrs
ESL English as a Second Language
Literacy in a Second Language
MWF
Script Execution
When the script is run, the following should occur. All script output should appear exactly as it
appears below.
Upon running your script, the user should be presented with the following menu:
Enter one of the following actions or press CTRLD to exit.
C create a new course record
R read an existing course record
U update an existing course record
D delete an existing course record
E update enrolled student count of existing course
T show total course count
The user then enters a onecharacter action upper or lowercase leading to one of the following.
C: a course is created
a From the terminal, read the following one at a time:
i Department code twotothree character string
ii Department name string possibly containing whitespace
iii. Course number integer
iv Course name string possibly containing whitespace
v Course schedule string in MWFTH
vi Course start date string with slashes
vii. Course end date string with slashes
viii. Course credit hours unsigned integer
ix Initial course enrollment unsigned integer
b Using the values entered by the user, create a new file in the data folder based on the
instructions above.
c Update dataquerieslog by adding the following line:
date CREATED: deptcode coursenum coursename
where date is the output from the date command and deptcode, coursenum, and
coursename are the corresponding values.
d If the course already exists, print the following error and continue with the script. The
script should accept all seven inputs before checking if the record exists.
ERROR: course already exists
R: read an existing courses information
a Prompt the user for a course department and course number: egcs
Enter a department code and course number:
b Search for the specified course using the provided department and number egcs
c Print the course information in the following format:
Course department: deptcode deptname
Course number: coursenum
Course name: coursename:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started