Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that displays information about the Computer Science semester schedule. Your program will require two Java files: your main program and a Course

Write a program that displays information about the Computer Science semester schedule. Your program will require two Java files: your main program and a Course class. The Course class must contain the following class instance data: data example Course number COMP163 CRN 20781 Instructors last name Williams Days the course is taught MWF Start time of the class 1000 Room where the class will be held Graham210 Title of the course Intro to Computer Programming All data should be represented as strings. Your class must include a constructor method that initializes all the data values. No other methods are required if you make the data values public. The main program should read the file CScourses.txt and create a Course object for each course in the file. Each line of data in the file has the course information in the same order as shown above. Except for the title of the class, all data are one word separated by white space.

image text in transcribed

image text in transcribed

Cscourses.txt:

COMP163 22623 Kim R 0800 HINES100 Intro Computer Programming COMP167 22627 Bryant MWF 1100 HINES100 Computer Program Design COMP180 20481 Esterline MWF 0900 GRAHA210 Discrete Structures COMP200 20871 Brown T 1500 TBD Computer Sci Sophomore Colloq COMP267 21510 Hinton MW 1800 TBD Data Base Design COMP280 20028 Brown TR 0930 MCNAI129 Data Structures COMP285 20426 Carr MWF 1100 MCNAI205 Analysis of Algorithms COMP300 20998 Brown R 1300 TBD Computer Science Jr Colloquium COMP320 21508 Nowaczyk-Pioro TR 1500 MCNAI130 Fundamentals of Cyber Security COMP322 20569 Esterline MW 1800 MCNAI129 Internet Systems COMP350 21509 Carr MWF 1200 MCNAI205 Operating Systems COMP360 20031 Esterline MWF 1400 GRAHA210 Programming Languages COMP365 20032 Xu MWF 1000 MCNAI129 Program Methodologies & Concepts COMP375 20482 Limbrick MWF 1300 GRAHA210 Computer Architecture & Org COMP385 20033 Kim TR 1100 MCNAI129 Theory of Computing COMP390 20035 Nowaczyk-Pioro online online online Social Implications of Computing COMP397 20414 Bryant TBD TBD TBD Co-Op Experience I COMP410 21511 Roy TR 0930 GRAHA210 Software Engineering COMP445 22756 Roy TR 1700 TBD Introduction to AI COMP476 20036 Xu MWF 0900 GRAHA208 Networked Computer Systems COMP494 22376 Bryant TBD TBD TBD Independent Study COMP495 22070 Carr TBD TBD TBD Senior Project I COMP496 21512 Anwar TR 0930 MCNAI205 Senior Project II COMP621 20038 Yu MWF 1400 MCNAI129 Web Security COMP681 20098 Esterline MW 1500 MCNAI129 Formal Methods COMP710 20570 Roy TR 1500 GRAHA208 Specifications and Design COMP727 20571 Yuan online online online Secure Software Engineering COMP775 22641 Xu MWF 1400 MCNAI130 Advance Design Analysis Algorithms COMP796 many many TBD TBD TBD Master's Project COMP797 many many TBD TBD TBD Master's Thesis COMP799 20330 Bryant TBD TBD TBD Continuation of Research COMP892 22759 Anwar TR 1100 TBD Doctoral Research Methods COMP895 22075 Anwar TR 1300 MCNAI132 Usable Security COMP991 20999 Yu TBD TBD TBD Doctoral Qualifying Exam COMP993 22074 Esterline TBD TBD TBD Doctoral Supervised Teaching COMP994 22302 Bryant TBD TBD TBD Doctoral Research Examination COMP995 21099 Bryant TBD TBD TBD Doctoral Preliminary Exam COMP997 21097 Bryant TBD TBD TBD Doctoral Dissertation 
COMP163 Course Information Program Write a program that displays information about the Computer Science semester schedule. Your program will require two Java files: your main program and a Course class. The Course class must contain the following class instance data data Course number CRN Instructor's last name Days the course is taught Start time of the class Room where the class will be held Title of the course example COMP163 20781 Williams MWF 1000 Graham210 Intro to Computer Programming All data should be represented as strings. Your class must include a constructor method that initializes all the data values. No other methods are required if you make the data values public. The main program should read the file CScourses.txt and create a Course object for each course in the file. Each line of data in the file has the course information in the same order as shown above Except for the title of the class, all data are one word separated by white space As your program reads each line of the file, the Course object should be put into a hash table. A hash table is a data structure that allows you to retrieve information based on a key. Your program will put the Course objects in the table using the course number as the key. You will need to create a hash table object at the beginning of your program with java.util. HashtableString, Course> hash new java.util.Hashtable(); You can put data into the hash table using the put method and retrieve data using the get method. The put method has two parameters, the key and the object to be put in the hash table. The get method has only one parameter, the key to be used to find the corresponding object. To put the data in the hash table use Course csClass = new Course ( courseNumber, crn, other parameters) ; hash.put( courseNumber, csClass) After your program has read all of the data from the file, it should ask the user to enter a course number (such as COMP163) from the keyboard. It should then use the get method to find the data in the hash table and display the information. The get method will return the Course object with the given course number. If the get method does not find a class in the hash table with that number, i will return null. Your program must check if the returned value is equal to null and, if it is, display a message indicating there is no such class. EnteredNumber - keyboard.next ) Course found -hash.get EnteredNumber if (found == null) //if course is not in the table

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

What are retained earnings?

Answered: 1 week ago