3/17/2021 Setting Up the Schedule https://www.cs.odu.edu/~zeil/cs361/latest/Assts/assoc_courseSched/index.html 1/2 Setting Up the Schedule CS361 Contents: 1 Overview 2 Instructions 3 Problem...

I have attached all of the information for this assignment in files, as well as the starter code (zip file). The assignment to do is "Setting Up the Schedule", DO NOT complete the "Courses of Action" assignment, this was only added as a file because it provides useful background information and shows the desired input and output of the program.


3/17/2021 Setting Up the Schedule https://www.cs.odu.edu/~zeil/cs361/latest/Assts/assoc_courseSched/index.html 1/2 Setting Up the Schedule CS361 Contents: 1 Overview 2 Instructions 3 Problem Description 4 Notes Please read the instructions on How to Prepare and Submit Assignments. This assignment builds upon the previous one and produces the same program and similar unit tests. In this assignment, you will practice working with the associative containers. 1 Overview In our previous assignments dealing with course schedules, the focus has been on the Faculty class, which served mainly as mechanism for associating faculty names with the sections that they taught. Now we are going to simplify the code significantly by doing away with the Faculty class altogether. Instead, we will ask the Department class to keep track of which faculty teach what sections. The new Department class will allow us to add faculty names: department.add("Babbage, Charles"); and will provide iterators to get access to the sorted list of faculty names. It will allow us to record that a faculty member is teaching a particular course section: department.teaches ("Babbage, Charles", cs201Section1); and to later ask for the collection of all courses being taught by a faculty member: set

sections = department.taughtBy ("Babbage, Charles"); Your task is to implement this new Department class. 2 Instructions https://www.cs.odu.edu/~zeil/cs361/latest/Directory/outline/ mailto:[email protected]?subject=CS361%2C%20Setting%20Up%20the%20Schedule https://www.cs.odu.edu/~zeil/cs361/latest/Public/submitting/index.html https://www.cs.odu.edu/~zeil/cs361/latest/Assts/list_courseSched/index.html 3/17/2021 Setting Up the Schedule https://www.cs.odu.edu/~zeil/cs361/latest/Assts/assoc_courseSched/index.html 2/2 1. Get the files for this assignment. Compile the program “as is” to familiarize yourself with it. (There will be errors complaining about undefined member functions for the Department class.) Files for this assignment may be found here or, if you are logged in to one of the CS Dept. Linux machines, in ~zeil/Assignments/cs361/assoc_courseSched/. 2. The declaration of the Department class has been changed along the lines described above. You need to complete the Department class by selecting the appropriate data structures to use as data members in department.h and then implementing the function members in department.cpp. 3. Your code will be evaluated both on its ability to function correctly within the printSchedule application and on its ability to pass the various unit tests provided. In the test report, tests 0…4 test the printSchedule application. Tests numbered 5…7 check the unit tests. 4. When you are ready to submit, use the button below: Submit this assignment 3 Problem Description Refer to the problem description from the previous assignment. 4 Notes Although it is possible to implement Department using a single data member, I think you will find it easier to use two: One to keep track of the known faculty member names. One to keep track of what sections are taught by which faculty member. Pay attention to your big-O! The associative containers allow for fast searching. Do not loop through the entire container doing a sequential search. © 2016-2021, Old Dominion Univ. https://www.cs.odu.edu/~zeil/cs361/latest/Assts/assoc_courseSched/Public/assoc_courseSched.zip https://www.cs.odu.edu/~zeil/cs361/latest/Assts/prereq_courseSched/index.html#problem-description https://www.cs.odu.edu/~zeil/cs361/latest/Directory/outline/ mailto:[email protected]?subject=CS361%2C%20Setting%20Up%20the%20Schedule 3/17/2021 Courses of Action https://www.cs.odu.edu/~zeil/cs361/latest/Assts/prereq_courseSched/index.html#problem-description 1/5 Courses of Action CS361 Contents: 1 Instructions 2 Problem Description 2.1 Input 2.2 Output 2.3 Example 2.4 Running the Program 3 Notes Please read the instructions on How to Prepare and Submit Assignments. 1 Instructions 1. Read the problem description below. 2. Files for this assignment may be found here or, if you are logged in to one of the CS Dept. Linux machines, in ~zeil/Assignments/cs361/prereq_courseSched/. Get the files for this assignment. Compile the program “as is” to familiarize yourself with it. It will not compile correctly in its current form, as several Faculty functions are missing and need to be written. The error messages, however, may serve as partial hints about what need to be filled in. 3. Your focus in this assignment will on the implementation of the Faculty class in files faculty.h and faculty.cpp. This class stores information about department faculty and the course sections they are teaching. Although the immediate use of Faculty is in support of this printSchedule program, we anticipate the possibility that Faculty may be reused in other future projects, so we want to make sure that it is designed and implemented to facilitate that reuse. You will only be submitting your modified versions of faculty.h and faculty.cpp. You should not change any other source code files that contribute to this project (except, possibly, to add debugging output for your own purposes), as you will only be submitting those two files and I will test what you have submitted in conjunction with the original versions of the the other files. You should not change the private data members in faculty.h. (You may, if you wish, add additional private function members if doing so would aid you in completing the implementation.) You may need to change some of the public functions in faculty.h, but keep in mind that the Faculty class must continue to compile with the other code in this program. https://www.cs.odu.edu/~zeil/cs361/latest/Directory/outline/ mailto:[email protected]?subject=CS361%2C%20Courses%20of%20Action https://www.cs.odu.edu/~zeil/cs361/latest/Public/submitting/index.html https://www.cs.odu.edu/~zeil/cs361/latest/Assts/prereq_courseSched/Public/prereq_courseSched.zip 3/17/2021 Courses of Action https://www.cs.odu.edu/~zeil/cs361/latest/Assts/prereq_courseSched/index.html#problem-description 2/5 4. Your code will be evaluated both on its ability to function correctly within the printSchedule application and on its ability to pass the various unit tests provided. In the test report, tests 0…5 test the printSchedule application. Tests numbered 6…21 check the unit tests on the Faculty class. Each even-numbered test checks for correct behavior of the code. Each odd-numbered test checks to see if that same behavior is correct and entails no memory leaks or other common pointer/memory handling problems. 5. When you are ready to submit, use the button below: Submit this assignment 2 Problem Description The CS Dept offers a lot of courses each semester. Complicating matters, many course offerings are divided into multiple sections for administrative purposes. A single course offering by a single faculty member can have as many as 14 different sections (not counting attached labs or recitations). With most faculty teaching multiple course offerings, keeping track of who is responsible for each section is a challenge. This program is intended to read a list of course sections obtained from this schedule and to print a report listing the courses taught by each faculty member in the department. 2.1 Input Although you are not responsible for writing the code to read the input, the input format is described here so that you may create your own data for testing. Input for this program is presented in CSV (Comma-Separated Values) format, a common format for describing tabular data. CSV files can be edited in any spreadsheet program (e.g., excel), and are often used to exchange data between spreadsheets and other data sources. A CSV file is a text file, with each line representing one row in a table or spreadsheet. The data within each line is deivided by commas (‘,’) into the columns of the table or spreadsheet. For example, a row of three values might appear as 123,John Doe,470523 The data for a specific column may be enclosed in quotation marks ("). If so, the quotation marks are not considered to be part of the actual data value when inserted into the table/spreadsheet. E.g., the two rows "123","John Doe","470523" 123,John Doe,470523 represent identical data. If the data to be placed in a column is a string that itself contains commas, then that data must be enclosed in quotation marks. For example, https://www.cs.odu.edu/~zeil/courseSchedule/ 3/17/2021 Courses of Action https://www.cs.odu.edu/~zeil/cs361/latest/Assts/prereq_courseSched/index.html#problem-description 3/5 123,"Doe, John",470523 represents a row of three columns, as the second comma is part of a data field, not a separator. If the data to be placed in a column is a string that contains commas and quotation marks, then the internal quotation marks are doubled: 123,"Doe, John, a.k.a. ""Jack"" ",470523 For this program, the input will contain eight columns in each row. The first row is a header (for convenience when editing input files) and after that, each row represents one section. For example, CRN,SUBJ,CRSE,TITLE,CR HRS,TIME,DAYS,INSTRUCTOR 13785,CS,252,INTRO TO UNIX FOR PROGRAMMERS,1,HOURS ARR,,"ZEIL,S" 13863,CS,381,INTRO TO DISCRETE STRUCTURES,3,HOURS ARR,,"EL MESALAMI,A" 14084,CS,350,INTRO TO SOFTWARE ENGINEERING,3, 200-250PM,MWF,"ZEIL,S" 1. CRN is a unique identifier for each section. 2. SUBJ is the subject area part of the course name. 3. CRSE is the specific course within that subject. 4. TITLE is the long name for the course. 5. CR is the number of credit hours for the section. 6. TIME is the time of the day at which the section is taught. 7. DAYS is the days (MTWRFS) on which the section is taught and can be empty. 8. INSTRUCTOR is the name of the faculty member assigned to teach the course. 2.2 Output Output consists of a report written to standard output showing the faculty members in alphabetic order by name. For each faculty member, an indented list of sections is printed, one section per line. The sections are shown in order by course name (e.g., “CS361”). Sections with the same course name are ordered by CRN. Because the CRN for each section is unique, there will be no cases where two sections have the same course name and the same CRN. After all sections have been listed, a line is printed announcing the number of sections taught by that faculty member. A more detailed description of the output format is not provided here because you will not be responsible for the output format, only for parts of the calculations leading up to that output. If you add debugging output to the code, you must remove or comment it out before submitting. Extra output will be flagged as incorrect. 2.3 Example For example, given the input CRN,SUBJ,CRSE,TITLE,CR HRS,TIME,DAYS,INSTRUCTOR 16477,CS,250,PROBLEM SOLVING & PROGRMNG II,4,HOURS ARR,,"EL MESALAMI,A" 3/17/2021 Courses of Action https://www.cs.odu.edu/~zeil/cs361/latest/Assts/prereq_courseSched/index.html#problem-description 4/5 21512,CS,250,PROBLEM SOLVING & PROGRMNG II,4,HOURS ARR,,"EL MESALAMI,A" 13785,CS,252,INTRO TO UNIX FOR PROGRAMMERS,1,HOURS ARR,,"ZEIL,S" 13809,CS,330,OBJECT ORIENT PROGRAM/DESIGN,3,HOURS ARR,,"KENNEDY,T" 20654,CS,330,OBJECT ORIENT PROGRAM/DESIGN,3,HOURS ARR,,"KENNEDY,T" 14084,CS,350,INTRO TO SOFTWARE ENGINEERING,3, 200- 250PM,MWF,"ZEIL,S" 13863,CS,381,INTRO TO DISCRETE STRUCTURES,3,HOURS ARR,,"EL MESALAMI,A" 13867,CS,382,INTRODUCTION TO JAVA,1,HOURS ARR,,"ZEIL,S" 15478,CS,410
Mar 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here