Assignment Task :

Part 1: 

Programming exercise 1 

• Update the comments at the beginning of the Game class, the Room class and the message displayed by the printWelcome and printHelp method so that they describe your game. 

• Update the Game and Room class so that it creates the rooms and exits that you invented for your game. You do not need to add any items to your game yet. You will add items later. 

 

Programming exercise 2 

Your game scenario requires that there be items positioned throughout the world that the player can pick up and possibly use. An item sounds like something that should be represented by an object! So create an Item class to represent the items in your game. You will need to decide what fields your Item class needs to have, what parameters the constructor will require and what methods the class will have. At a minimum, items will have a name and a description. However, items may have many other attributes that make sense for your game (e.g. weight, colour, value, destructive power ..) 

 

Programming exercise 3 

Now that there is a class for representing Items we need a way to allow the rooms to contain an item. Modify the Room class so that items can be added to or removed from the room. You will need to think about what fields and methods to add to the Room class. Also, think about what the methods that you add should do when an attempt is made to add an item to a room that already contains an item, or an attempt is made to remove an item from a room that does not contain an item. 

 

Programming exercise 4 

Now that a room can contain an item, when the player enters a room he/she should be told about the item in that room (unless you have taken the item). Modify the appropriate code so that if the player enters a room containing an item, the name and description of the item are displayed along with the description of the room and the list of exits. 

 

Programming exercise 5 

Edit the code in the Game class so that the items for your game are created and added to the appropriate rooms at the start of the game. Recall that your game must include at least two items per room. Be sure to test any methods that you add or modify. 

Play the game to ensure that your items are appearing in the rooms. 

 

This Engineering Assignment has been solved by our Engineering Experts at UniLearnO. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Eureka! You've stumped our genius minds (for now)! This exciting new question has our experts buzzing with curiosity. We can't wait to craft a fresh solution just for you!

  • Uploaded By : Grace
  • Posted on : May 27th, 2019

Whatsapp Tap to ChatGet instant assistance