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

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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