Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 14 Sep 2017 My Price 8.00

different objects

A Door Class

A computer game usually has many different objects that can be seen and manipulated. One typical object is a door. Whether a player runs through a castle, attacks the forces of an evil empire, or places furniture in a room, a door often comes into play( not for Jupitrian).

Implement a Door class and describe below as well as a TestDoor that instantiates three Door objects labeled A????1EnterA????1,A????1ExitA????1, and A????1TreasureA????1. The A????1EnterA????1 door should be left unlocked and opened. The A????1ExitA????1 door should be left closed and locked. The A????1TreasureA????1 door should be left open but locked.

 

A Door class

A Door class can:

Display an inscription

Be either open or closed, and

Be either locked or unlocked.

Here are some rules about how Doors work:

Once the writing on a Door is set, it cannot be changed

You may open a Door if and only if it is unlocked and closed

You may close a Door if and only if it is open

You may lock a Door if and only if it is unlocked, and unlock a Door if and only if it is locked. You should be able to check whether or not a Door is closed, check whether or not it is locked, and look at the writhing on the Door if there is any.

The instance variables of a Door class are:

String inscription

Boolean locked, and

Boolean closed.

The methods (all public) should be:

Door(String c); // Constructor A????1 initializes a Door with inscription c , closed and locked

isClosed();        // Returns true if the Door is closed

isLocked();              // Returns true if the Door is locked

open();                     // Opens a Door if it is closed and unlocked

close();                     // Closes a Door if it is open

lock();               // Locks a Door if it is unlocked

unlock();           // Unlocks a Door if it is locked

Appropriate error messages should be displayed, if any conditions of the methods are violated.

Answers

(5)
Status NEW Posted 14 Sep 2017 08:09 PM My Price 8.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)