For all interactive tests, unless otherwise stated, the set up of the systems is as such: ----------- Welcome to Departmental Network Systems Enter how many systems: 5 Enter the system's room no: 10 System is assigned number 1 Enter the system's room no: 10 System is assigned number 2 Enter the system's room no: 20 System is assigned number 3 Enter the system's room no: 20 System is assigned number 4 Enter the system's room no: 30 System is assigned number 5 ----------- 1) For this problem, I simply added a method in ITSystem called toString(), and simply based it off the toString method in the Point object shown in the book, and using system.toString() inside the print method. It worked out very easily. I tested this by picking a random system and printing it ----------- Enter system inventory number, or 0 to quit: 1 System 1 selected Actions: exit, help, print, record-problem Enter action: print ID: 1, Room: 10, Problems Reported: 0 ----------- 2) For the second problem, I added in-same-room to the HELP string, then added a in-same-room option to the if/else series in the processActionsForITSystem method. I decided the simple thing was to run a for loop through all the ids of the systems array and check their room number against the room number of the selected system. I simply grabbed the room number using system.getRoomNo(), then used the same method call to check all the rooms #s of the array. When the same, it used the systems[i].toString() to print them out For tests, I simply tried using in-same-room on rooms with a single system and with multiple systems ----------- System 3 selected Actions: exit, help, print, record-problem, in-same-room Enter action: in-same-room Systems in same room as System 3: ID: 3, Room: 20, Problems Reported: 0 ID: 4, Room: 20, Problems Reported: 0 System 5 selected Actions: exit, help, print, record-problem, in-same-room Enter action: in-same-room Systems in same room as System 5: ID: 5, Room: 30, Problems Reported: 0 ----------- 3) The next one, i added "move" to the HELP string, then added move to the if/else chain. For this, I knew initially that I needed to get the old room # first (called oldr), then use promptInt to get the new one (r). I first tried to change the room number directly of the system, but couldn't because of the privatization of the variable in the ITSystem object. I then went into ITSystem and decided to change the room number there with a method, called changeRoomNo(int r). Once that was settled, I used for loops like the previous problem to print systems in the old room and new room. I also added a count variable to the old room's loop. In case the count ended up being zero, meaning nothing was left in the old room, it would print "none". This was not needed for the new room's loop because it should always have at least one (the new one). Tests include moving to the same room, to a new room, moving to an occupied room, and moving from a room that has nothing left and a room that does have other systems. (Note: All moves were made consecutively, without resetting). ----------- System 2 selected Actions: exit, help, print, record-problem, in-same-room, move Enter action: move Enter room for system 2 to move to: 10 System 2 is already in this room. System 1 selected Actions: exit, help, print, record-problem, in-same-room, move Enter action: move Enter room for system 1 to move to: 7 Systems now in old room 10: ID: 2, Room: 10, Problems Reported: 0 Systems now in new room 7: ID: 1, Room: 7, Problems Reported: 0 System 3 selected Actions: exit, help, print, record-problem, in-same-room, move Enter action: move Enter room for system 3 to move to: 7 Systems now in old room 20: ID: 4, Room: 20, Problems Reported: 0 Systems now in new room 7: ID: 1, Room: 7, Problems Reported: 0 ID: 3, Room: 7, Problems Reported: 0 System 4 selected Actions: exit, help, print, record-problem, in-same-room, move Enter action: move Enter room for system 4 to move to: 7 Systems now in old room 20: none Systems now in new room 7: ID: 1, Room: 7, Problems Reported: 0 ID: 3, Room: 7, Problems Reported: 0 ID: 4, Room: 7, Problems Reported: 0 System 1 selected Actions: exit, help, print, record-problem, in-same-room, move Enter action: move Enter room for system 1 to move to: 20 Systems now in old room 7: ID: 3, Room: 7, Problems Reported: 0 ID: 4, Room: 7, Problems Reported: 0 Systems now in new room 20: ID: 1, Room: 20, Problems Reported: 0 ----------- 4) The fourth and final problem is to add the ability to pick a system by its room number. First, I removed the use of prompt method calls, because we don't know if the input will be an Integer or String. Then I separated the main part of the whichITSystem into an if statement that checked if the next scanner input was, indeed, integer. If so, the method went like normal. Next I tried to create the code to read an input such as "room 20" and act appropriately. My first attempt at coding looked a lot like it does now, but at first I tried check == "room" to see if the input began with the word room. This didn't seem to work. I then placed in test words (the Bing Bam Boom prints in the code, which are now commented out) to identify where the problem was. I was the problem was in the if statement of the check String, so at first made the program print the values of check, as well as r, the room number after the word room. The check String did say room, but the if statement was not recognizing it. I looked at the class notes and decided to try the String object method check.equals("room"). This worked, and turned out to be the only problem. I then removed all the test printouts and ran tests on different scenarios The tests were on picking empty rooms, picking rooms with one system in them, and picking rooms with multiple systems (also trying to pick a faulty id when picking systems in a room) ----------- Enter system inventory number, room , or 0 to quit: room 25 No system in this room. Try again Enter system inventory number, room , or 0 to quit: room 20 System 1 selected Actions: exit, help, print, record-problem, in-same-room, move Enter action: exit Enter system inventory number, room , or 0 to quit: room 7 Room 7 has 2 systems. ID: 3, Room: 7, Problems Reported: 0 ID: 4, Room: 7, Problems Reported: 0 Enter system inventory number from above list, 0 to quit: 6 No system numbered 6; try again. Room 7 has 2 systems. ID: 3, Room: 7, Problems Reported: 0 ID: 4, Room: 7, Problems Reported: 0 Enter system inventory number from above list, 0 to quit: 3 System 3 selected Actions: exit, help, print, record-problem, in-same-room, move -----------