Purchase Solution

ShoutBox - Java Example

Not what you're looking for?

Ask Custom Question

You will create the ShoutBox class for your Virtual World. Your ShoutBox class will have a shoutOutCannedMessage() method that returns a String type. The shoutOutCannedMessage will use an Array or an ArrayList to store 10 messages of type String. For those of you that are more advanced with your Java skills, you could use a HashMap for the data structure. You can load this data structure with 10 messages of your choosing. For example, one message could be "I need Java!" You can initialize your Array or ArrayList with the messages or have the user enter the messages. The choice is yours. The shoutOutCannedMessage() will loop through the data structure to first display all canned messages and allow the user to select one. The shoutOutCannedMessage() will return the selected message String. Take a screenshot to verify that the selected message String is displayed successfully. Cut and paste the screenshot into a Word document and attach this document to your submission.

Submit your .java file as one zipped folder.

For additional details, please refer to the Module Seven User-Defined Methods Rubric document in the Assignment Guidelines and Rubrics section of the course.

Note: At their discretion, instructors may perform an originality check on submissions using Turnitin.

Purchase this Solution

Solution Summary

The code is very simple and easy to understand, written in Java. It has a ShoutBox class with a method by the name of shoutOutCannedMessage() to display 10 messages stored in an array list. First it display those messages using a for loop and then asks the user to input a message number to display that chosen message. Using if..else check it determines the user input and returns the requested method. The code can easily be modified. Two files are attached - ShoutBox.java and a screen shot of the code in action.

Solution Preview

Hi there,

Attached you will find a ShoutBox.java file containing shoutOutCannedMessage() method. The code is working as requested ...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.