Canned messages data structure

Assignment Help PL-SQL Programming
Reference no: EM131049713

Specifications for ShoutBox:

The ShoutBox object will allow you to shout messages into your virtual world. Your ShoutBox will have two ways of generating messages:

You can select from a list of canned messages to shout, or

You can have the ShoutBox generate a random message for you.

You must use data structures Array, ArrayList, or a HashMap to store the message data.

Canned messages: One data structure will store the canned messages. You can load this data structure with canned messages of your choosing. The shoutOutCannedMessage() method 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. This String will be displayed in the virtual world. For now, your virtual world will be the output window.

Random messages: To generate random messages, you need to have a data structure that holds a list of subjects, another data structure that holds a list of objects, another that holds a list of verbs, another that holds a list of adverbs, and another that holds a list of adjectives. The lists you create can hold as many words as you would like. The shoutOutRandomMessage() method will use a random number generator that selects one word from each data structure to form a random message. Random messages will be in the following form: Subject - Verb - Adjective - Object - Adverb.

The generated message String will be returned. The String will be displayed by the ShoutBox in the virtual world. For now, your virtual world will be the output window.

Partial class diagram for the ShoutBox object:

ShoutBox

String shoutOutRandomMessage()
String shoutOutCannedMessage()

Examples of canned messages stored in the canned messages data structure (you can store as many canned messages as you would like):

"Hello World"
"I am studying"
"I am at work"

Example of subjects stored in the subjects data structure:

"I"
"You"

Example of objects stored in the objects data structure:

"course"
"homework"

Example of verbs stored in the verbs data structure:

"studying"
"eating"
"sneezing"

Example of adjectives stored in the adjectives data structure:

"funny"
"prickly"
"hard"
"awesome"

Example of adverbs stored in the adverbs data structure:

"quickly"
"everywhere"

The following critical elements will be addressed in this submission:

1. The method shoutOutCannedMessage() loops through the data structure that stores the canned messages first to display all canned messages and allows the user to select one canned message.

2. The method shoutOutCannedMessage() will return the selected message string.

3. Your shoutOutRandomMessage() method should use a random number generator that selects one word from each data structure to form a random message. The random number generated should not exceed the bounds of your data. In other words, if you only have 5 words in a data structure, the random number generated should not be an index that has no word stored.

4. The method shoutOutRandomMessage() should return a randomly generated message string in accordance with specifications, in the following form:

5. Subject - Verb - Adjective - Object - Adverb (for example, "You read hard books quickly").

Reference no: EM131049713

Questions Cloud

Propose a cloud-based storage service : For this assignment, imagine that you have been hired by ABC, Inc., a global company, to propose a cloud-based storage service appropriate for a globalized company to use to back up their machines.
How does the artist use the elements of art : How does the artist use the elements of art (line, value, color, shape, texture)? How does the artist organize the elements of art to create artwork that you respond to (positive or negative!)?
Mutual fund that is expected to earn rate of return : Suppose you invest $1000 into a mutual fund that is expected to earn a rate of return of 11%. How much money will you have in 10 years? If $8000 is invested in a certain business at the start of the year, the investor will receive $2400 at the end of..
The northern california power agency : Apower consortium that distributes a mix of "green" and conventional electricity is implementing an XML-based settlements system that drives costs out of power distribution.
Canned messages data structure : Examples of canned messages stored in the canned messages data structure (you can store as many canned messages as you would like):
Determine the concentration of product at t=2h assuming p0=0 : Determine the concentration of biomass at t=2h assuming quasi steady state. If alpha=0.2g/g Determine the concentration of product at t=2h assuming P0=0
Needed to fix something in account : Assume an IT technician was working on your machine because they needed to fix something in your account, and you shared your credentials with them so they could do their work.
What is the present value of investment-interest rate : Investment X yields a payment of $5000 at the end of year 1, a payment of $7000 at the end of year 2, a payment of $9000 at the end of year 3, and a payment of $11000 at the end of year 4. Investment Y yields a payment of $11000 at the end of year 1,..
How should dsi assess risk of adopting a cloud-based osds : What model should DSI adopt for a cloud-based OSDS - how should DSI assess the risk of adopting a cloud-based OSDS?

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Show the customer id and customer name in given database

prepare a query to show the customer id and customer name in given database.

  Create student sorting table

Student.txt in the attachment contains the roster of a class. Each student object has the following fields: student id, last name, first name, academic level.Create a RosterClass to store the student database in vector.

  Write an sql statement to produce a single column called

write an sql statement to produce a single column called itemlocation that combines the skudescriptionthe phrase is

  Write a plsql block and declare a variablenbspvsalnbspof

write a plsql block and declare a variablenbspvsalnbspof the type number. include the following statement in the

  Produce a report showing an organization chart

Produce a report showing an organization chart for Mourgos's department. Print last names, salaries, and department IDs and create a report that shows the hierarchy of the managers for the employee Lorentz. Display his immediate manager first

  Write functions to perform the following tasks

Write a function, called ‘binarySearch', implements a binary search. This function should take three parameters.

  Create an index used for this query.save your sql in a file

Create an index that will be used for this query and therefore speed up its response time. Save your SQL in a file.

  Create a new database in sql server and run

Create a new database in SQL Server and run the following CREATE TABLE commands. Note that you must run the CREATE TABLE statements in the order presented (and load the data in the order presented) to avoid conflicts resulting from foreign key con..

  Write an sql select statement that would re-organize result

Write a program in the language of your choice to calculate the sum of all the multiples of 3 or 5 below 1000. Include the source code and the calculated value in your answer.

  Test and compile the sql queries

The Strayer Oracle Server may be used to test and compile the SQL Queries developed for this assignment. Your instructor will provide you with login credentials to a Strayer University maintained Oracle server.

  Database analysis and design

Implement the initial database design for the Customer Relationship Management VIEW as described below in your selected RDBMS. You need to create the Entity-Relationship model from your normalization and Database analysis, define tables, primary k..

  Write sql statements to list all columns for all tables

Write SQL statements to list all columns for all tables. Write an SQL statement to list ItemID and ItemDescription for all items that cost $1000 or more.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd