Create a myclone class that will represent a virtual clone


Final Project Guidelines and Grading Guide

Overview

Your final project for this course is the creation of a Virtual World Java application that results in a virtual world, complete with an object that will act as a human clone. A virtual world with a human clone would not be complete without additional objects for interaction, so you will be responsible for creating a "ShoutBox" and another object that will keep your human clone from getting lonely, and a virtual world application that will test your objects. Your final deliverables will include your working code (which your instructor will run in order to review your virtual world) as well as an annotated version of your written code that explains your reasoning for choices, how the code meets the given specifications for your project, how you ensured the accuracy and workability of your code, and methods used for testing and debugging.

The project is divided into four milestones, which will be submitted at various points throughout the course to scaffold learning and ensure quality final submissions. These milestones will be submitted in Modules Two, Five, Seven, and Eight. The final submission will be submitted in Module Nine.

In this assignment you will demonstrate your mastery of the following course outcomes:

- Write simple, accurate object-oriented programs using primitive data types, variables, data structures, and object-oriented principles
- Implement classes that meet the given specifications of object instance variables and behaviors
- Create operative algorithms using sequential logic structures, decision control structures, and loops
- Create and use methods that accept parameters and return results
- Test and debug object-oriented programs for accuracy in program functionality
- Document object-oriented code with comments that articulate the purpose and behavior of code for various audiences

Prompt
In creating your virtual world, you will need to create a MyClone class that will represent a virtual clone, another class that will represent a ShoutBox, and another class of your choice. The class of your choice can be anything you want to exist in your virtual world (a cat, a bird, a computer, etc.). This project is a prototype and there will not be any graphics, so you will create an application that unit tests the functionality of your three classes (your MyClone class, your ShoutBox class, and the class of your choice).

Specifications for MyClone

Feel free to add additional instance variables and behaviors, but your clone object must have instance variables firstName, lastName, and an introduction() method. The firstName and lastName instance variables will hold your first and last names. You will demonstrate your understanding of encapsulation by protecting your instance variables by making them private and by creating getters and setter methods for all instance variables. You should have at least one

constructor created that initializes all instance variables. The introduction() method will introduce you to the virtual world by displaying a greeting, your full name, and anything else you would want to say.
Partial class diagram for the MyClone object:


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:

1. You can select from a list of canned messages to shout, or
2. 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.

While the listed number of instance variables and methods are the minimum number required for each class, you are free to create additional.

Specifically, the following critical elements must be addressed:

I. Program Functionality and Alignment
a. Make sure your entire program functions correctly and that there are no exceptions or compile errors
b. In writing your code, make sure that you are meeting or exceeding all of the given specifications for each class. Although you will be graded on coverage of stated requirements, you are free to use your creative touch in developing additional classes and objects with additional instance variables should you wish.

c. Create the unit test application and use it to test the functionality of each class. Submit the screenshots showing that the code was tested.

II. Data Structure for Message Storage: Use data structures (either Arrays, ArrayLists, or a HashMaps) to store the message data in accordance with the given specifications. You can use one type, or a mix of the listed types of data structures for message storage. Specifically, it should be one data structure per word type (verb, subject, etc.), but you can choose to use a HashMap for canned messages and maybe ArrayLists for the other data structures or use Arrays for all of them.

III. Methods and Instance variables
a. 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.
b. The method shoutOutCannedMessage() will return the selected message string.
c. 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.
d. The method shoutOutRandomMessage() should return a randomly generated message string in accordance with specifications, in the form: Subject - Verb - Adjective - Object - Adverb (for example, "You read hard books quickly").
e. Use the MyClone introduction() method to introduce your clone to the virtual world by displaying a greeting, your full name, and anything else you would want to say.
f. MyClone class should include instance variables (at least firstName and lastName) that are made private and have associated getters (accessors) and setters (mutators) for all instance variables.
g. You should build an additional class of your choice, which should have at least 2 private instance variables with associated getters (accessors) and setters (mutators) and 1 method your choice.
IV. Test Application: You will create one application that will test all three classes.
a. Perform a unit test of the MyClone to test all getters (accessors) and setters (mutators)and method(s) of the class.
b. Perform a unit test of the ShoutBox to test all methods of the class.
c. Perform a unit test of the additional class object to test all getters (accessors) and setters (mutators) and method(s) of the class.
V. In-Code Comments
a. Make sure your object-oriented code is accurately documented to explain the purpose and behavior of the code.
b. Articulation of comments is clear and concise for the audiences that may review it, including your instructor and individuals that may need to maintain or implement the code.

Milestone One: MyClone Class

Milestones

In Module Two, you will submit your Java class, MyClone. You will create your initial version of the MyClone class. MyClone class should have instance variables firstName and lastName. The firstName and lastName instance variables hold a value for first and last names respectively. You will demonstrate your understanding of encapsulation using the private specifier to restrict access to your instance variables. This milestone is graded with the Milestone One Rubric. Feedback should be incorporated into the final project as warranted.

Milestone Two: Message Array
In Module Five, you will submit your Java code that creates an Array of String messages. Write an application that uses an Array to store 10 messages of type String. You will store this Array with 10 messages of your choosing. For example, a message could be "I love Java the programming language!" or another message could be "I love Java the drink!" You may initialize your Array with the messages or have the user enter the messages. The choice is yours. Your Java code will loop through the Array to iterate through your entire list and display each message and allow the user to select one. The shoutOutCannedMessage() will return the selected message String. This milestone is graded with the Milestone Two Rubric. Feedback should be incorporated into the final project as warranted.

Milestone Three: Programmer-Defined Class
In Module Seven, You will create a Virtual World application as your final project. This Virtual World will have several objects including a MyClone object and another object of your choice. It would be an excellent idea to review the Final Project Guidelines at this time. For this Third Final Project Milestone, you will finish development of your MyClone class and create another class of your choice.

In Module Two, you started development of the MyClone class. You will continue to develop the MyClone class by adding accessor methods, mutator methods, and an introduction() method. You will create an accessor and mutator method for each instance variable declared in the MyClone class. The introduction() method will introduce yourself to the virtual world by displaying a greeting, your first and last name, and anything else you would want to say.

You will also create another class of your choice. Your programmer-defined class should have at a minimum two instance variables and one method. The instance variables and method should be representative of the data and behavior that objects of this class will have. You will demonstrate your understanding of encapsulation by declaring the instance variables as private and by creating accessors and mutators for each instance variable. You should have at least one constructor created that initializes all instance variables. Document your code. This milestone is graded with the Milestone Three Rubric. Feedback should be incorporated into the final project as warranted.

Milestone Four: ShoutBox Class With Methods
In Module Eight, you will create the ShoutBox class for your Virtual World. Your ShoutBox class will have two methods:

Method shoutOutCannedMessage()will return type String.
The shoutOutCannedMessage will use an Array or an ArrayList to store 10 messages of type String. For those of you who 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. 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. Document your shoutOutCannedMessage() method to explain the code.

Method shoutOutRandomMessage() method will return type String.

The shoutOutRandomMessage() will use several Arrays or an ArrayList to store words. You will have one data structure that holds a list of words that are subjects, another data structure that holds a list of words that are objects, another that holds a list of verbs, another that holds a list of adverbs, and another that holds a list of adjectives. You can initialize your data structures with words or have the user enter the words. The choice is yours.

The shoutOutRandomMessage() method will use a random number generator that selects one word from each data structure to form a random message. The shoutOutRandomMessage() method will return the random message as a String data type. Random messages will be of the following form: Subject - Verb - Adjective - Object - Adverb.

Document your shoutOutRandomMessage() method to explain the code.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create a myclone class that will represent a virtual clone
Reference No:- TGS02381148

Now Priced at $15 (50% Discount)

Recommended (96%)

Rated (4.8/5)