Question: Implement CourseRecordIO. readCourse() To finish the CourseRecordIo class and pass all of the CourseRecordIOTest s, you need to implement CourseRecordIo. readCourse(). The method receives a

 Implement CourseRecordIO. readCourse() To finish the CourseRecordIo class and pass allof the CourseRecordIOTest s, you need to implement CourseRecordIo. readCourse(). The methodreceives a String which is a line from the input file. An

Implement CourseRecordIO. readCourse() To finish the CourseRecordIo class and pass all of the CourseRecordIOTest s, you need to implement CourseRecordIo. readCourse(). The method receives a String which is a line from the input file. An example line might be: CSC 116, Intro to Programming - Java, 001, 3, jdyoung2, MW, 0910, 1100 or CSC 216, Software Development Fundamentals, 601, 3, jctetter, A You can use a Scanner to process the String parameter. You must break the line up into tokens by using the comma character (e.g., ' ' ' as a delimiter. A delimiter is a string that is used to separate or break apart a larger string. The default delimiter for scanner is white space. You can change the delimiter using the Scanner.useDelimiter() method. After updating the delimiter, any call to Scanner.next() will return the token before the next delimiter. So for our example, CSC 216, Software Development Fundamentals, 601, 3, jctetter, A the first call to Scanner. next() would return a string "CSC 216", the second call to Scanner.next() would return a string "Software Development Fundamentals", etc. When reading the values for credits, startTime, or endTime, you can use Scanner. nextInt (). Once you break the line into tokens, you can construct a Course object and return it from the method. There are two places where code that you work with may lead to an exception for invalid values in the input string: > NoSuchElementException or InputMismatchException: if you receive these when processing the input, catch them and throw an IllegalArgumentException to the caller (which in this case is CourseRecordIO. readCourseRecords ()). > IllegalArgumentException: when constructing a Course with invalid values, the Course class will throw an IllegalArgumentException. In this case DO NOT catch the exception! Instead, let the exception propagate to the caller (which in this case is CourseRecordIo.readCourseRecords()) Use the fields and constructors of the cour ce class to help vou determine what type each token should be. The tokens will always be in the order of: If the meeting days string is NOT "A", then you'll need to read in the last two tokens. If there are any additional tokens after the expected last one, an IllegalArgumentException should be thrown. The high level structure of the method is provided in the pseudocode, below. You do not have to implement the method this way, but it will be useful for getting started. JAVA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!