Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Please help!*** *MAKE SURE TO READ CAREFULLY AND FULFILL ALL REQUIREMENTS FOR FULL POINTS!!!* Will reward points, thanks so much in advance! HW7: Digitoids CSS

***Please help!***

*MAKE SURE TO READ CAREFULLY AND FULFILL ALL REQUIREMENTS FOR FULL POINTS!!!*

Will reward points, thanks so much in advance!

HW7: Digitoids CSS 161 - Fundamentals of Computing

Summary: In a hypothetical world, a new mobile game emerges where players collect digital characters called Digitoids. The players start out with a selection of Digitoids (specific to the region of world they began at) from which they choose one to be their first Digitoid. However, players can also visit famous landmarks (e.g. Space Needle) to purchase a special code to get a randomly chosen Digitoid that are available only in that landmark (e.g. a rock and roll green martian). There are two modes for these Digitoids a Virtual Reality mode where the Digitoid will interact with other Digitoid in a persistent virtual world in the Cloud and an Augmented Reality world where the Digitoid can interact with the real world such as finding discounts, giving you information about sights, provide directions, etc. For this homework assignment, create a simplified version of a Digitoid and the corresponding Driver class.

Skills Expected:

Overrides: toString, equals

Runtime Exception

Enums*

Assignment Description:

You will create two Class objects (and subsequently submit two .java files)

Digitoid

Driver Notes:

ONLY the Driver Class should have static methods.

The Device Class should NOT have static methods or static instance variables (constants ok).

The below is the minimum you must include you could include additional instance variables, methods, etc. as you need.

Class Design:

Digitoid The Digitoid class is intended to be an abstract and simplified representation of a digital character. Each Digitoid must have some properties associated with it. Data to store:

Digitoid name o Make this a private instance with a public getter and setter

Digitoid type (e.g. humanoid, robotic, aquatic, flying, insectoid, alien/xenomorph, etc.)

-Make this a private instance with a public getter and private setter

Experience (representing how mature the Digitoid is)

-Make this a private instance with a public getter and private setter

Available actions

[2 Points] Constructor

-Take in as argument the Digitoid name (enforce invariants) set to a default type of your choice.

-Throw an exception as necessary

[2 Points] Overloaded Constructor

-Take in as argument the Digitoid name as well as type (enforce invariants)

-Throw an exception as necessary

[4 Points] Interact with another Digitoid

-If the other Digitoid is:

More experienced, increase experience by 3

Equally experienced, increase experience by 2

Less experienced, increase experience by 1

Of the same type, multiple experience gained by 2

Of another type, multiple experience gained by 3

The same Digitoid (e.g. equals() returns true), halve all experience gained through this interaction (multiply experience again by 0.5)

[2 Points] toString() override:

-You decide what String it should return (should use at least one of the properties above)

[2 Points] equals() override

-You decide what makes two instances equal (should compare at least one property)

Class Design: Driver

Positive testing (checking for valid conditions)

-[1 Point] Create a Digitoid with only name

-[1 Point] Create a Digitoid with both name and type

-[1 Point] Compare two Digitoids where the equals() method returns true

-[1 Point] Compare two Digitoids where the equals() method returns false

-[1 Point] Print the toString() of a Digitoid

Negative testing (checking for invalid conditions)

- [1 Point] Attempt to create a Digitoid with invalid name (e.g. empty string)

-[1 Point] Attempt to interact with itself (should NOT be allowed) Interaction Testing

Test every type of interaction possible for a Digitoid (call the interact method):

-[1 Point] Same type, higher experience

-[1 Point] Same type, same experience

-[1 Point] Same type, lower experience

-[1 Point] Different type, higher experience

-[1 Point] Different type, same experience

-[1 Point] Different type, lower experience

-[1 Point] Where equals() is false

-[1 Point] Where equals() is true

Grading Criteria:

[12 Points] Digitoid class (See Assignment Description for breakdown of points)

[15 Points] Driver class (See Assignment Description for breakdown of points)

[1 Points] Method JavaDoc (comment block) containing at minimum: description of method and @param and @return

[1 Point] Descriptive variable names

[1 Point] Appropriate class header comment block

[Extra Credit: 2 Points] for using Enums for any properties

PROGRAMMING LANGUAGE: JAVA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions