Attached Files: File Rooms.txt (427 B) Imagine we were creating a Textbased Adventure Program where a user can navigate through a series of rooms and pick up items, use them, put them down and get points. This assignment has us just reading the rooms of a game from a file into our program and displaying the rooms, not building the entire game. Create a new Java Project. Name it TestReadRoomFile or something like that. Add a Room class to the project according to the following UML. Room -roomNumber: int the room number -roomName: String the name of the room -description: String the description of the room +Room(roomNumber: int, roomName:String, description:String) Constructor. Assign the parameters to the instance variables. +getRoomName():String returns the name of the room +getRoomNumber(): int returns the room number +getDescription(): String returns the description +toString():String returns a string with all the room information. Create a ReadRoomFile class similar to the OOP example for Courses and Superbowl Games to read the rooms.txt file that is attached and return an Arraylist of Room objects. In main, call your method that reads the room file, then have main() simply display each room. Fully document Room and ReadRoomFile classes and your test main class. Add comments to the top of each class file, comment each instance variable and each method. Method comments should include the description, @param and @return comments. Comment each variable and block within the methods.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
Attached Files: File Rooms.txt (427 B) Imagine we were creating a Textbased Adventure Program where a user can navigate through a series of rooms and pick up items, use them, put them down and get points. This assignment has us just reading the rooms of a game from a file into our program and displaying the rooms, not building the entire game. Create a new Java Project. Name it TestReadRoomFile or something like that. Add a Room class to the project according to the following UML. Room -roomNumber: int the room number -roomName: String the name of the room -description: String the description of the room +Room(roomNumber: int, roomName:String, description:String) Constructor. Assign the parameters to the instance variables. +getRoomName():String returns the name of the room +getRoomNumber(): int returns the room number +getDescription(): String returns the description +toString():String returns a string with all the room information. Create a ReadRoomFile class similar to the OOP example for Courses and Superbowl Games to read the rooms.txt file that is attached and return an Arraylist of Room objects. In main, call your method that reads the room file, then have main() simply display each room. Fully document Room and ReadRoomFile classes and your test main class. Add comments to the top of each class file, comment each instance variable and each method. Method comments should include the description, @param and @return comments. Comment each variable and block within the methods.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT