Starting from:

$35

COP3330 Homework 5- File I/O Solution

COP 3330- HW on File I/O
Lines in lec.txt are of the form:
89745,COT6578,Advanced Computer theory,Graduate,F2F,PSY-108,No
32658,COT6578,Advanced Computer theory,Graduate,Mixed,LPS-35,No

That means that the CSD offers two sections of COT6578, one is F2F and the other is online. Both of those sections don’t have labs.

Example:
69745,COP5698, Programming Languages,Graduate,F2F,CB2-122,YES
19745,MSB-123
36598,PSY-100
20315,HSA1-116

That means the COP5698 with crn 69745 has three labs. 19745, 36598 and 20315 are the crns of the labs.
MSB-123, PSY-100 and HSA1-116 are the building-room numbers where those labs are scheduled to take place.

Note that if the Modality is Online, then the line of the lec.txt has the form:
89745,COP4578,Software Engineering,Undergraduate,Online

Write a Java program that:
1) Counts how many online classes offered at the CSD
2) Displays the crns of the lectures and Labs that are being held in a given classroom that you ask the user for.
3) Create a textfile (name it lecturesOnly.txt) that lists the online and the no-lab lectures. See sample run below


Sample Run:

- There are 4 online lectures offered
- Enter the classroom: MSB-123
The crns held in MSB-123 are: 19745
- lecturesOnly.txt is created

Goodbye !

Given the content of lec.txt, lecturesOnly.txt should be:

Online Lectures
66636,DIG2158,Introduction to Digital Systems,Undergraduate,Online
36636,SOF2058,Introduction to Software,Undergraduate,Online
51180,CDL2587,Introduction to Computers,Undergraduate,online 36637,SOF2058,Introduction to Software,Undergraduate,Online

Lectures with No Lab
89745,COT6578,Advanced Computer theory,Graduate,F2F,PSY-108,No
32658,COT6578,Advanced Computer theory,Graduate,Mixed,LPS-35,No

More products