Question: (2a) Model a physical entity as a Java Class (70 points) focus on Encapsulation : This is an Object Modeling/Programming exercise albeit around 1 (maybe
(2a) Model a physical entity as a Java Class (70 points) focus on Encapsulation:
This is an Object Modeling/Programming exercise albeit around 1 (maybe 2) Object(s). Using the Radio Class implementation provided as a point of reference, think of a common (or maybe, not so common) physical device or appliance thats worthy of modeling as an Object. Consider the following:
The basic operations/functionality of your device/appliance become public methods of the implementing Class (e.g., on, off, go, start, stop, )
The internal structure (or how you envision the internal structure) of your device/appliance become the data members of the implementing Class. This would include the internal piece-parts of the device and well as state components. For example, modeling a bread toaster might require a heat coil as well as a power on/off indicator.
In the spirit of modularity, reusability, etc., private/protected methods can and should be used to implement sub-tasks performed by public methods.
In addition to Class members supporting (a) (b) (c) above, you also need to implement:
Either a public void main(String [] ){} method or a second launch Class whose only job will be to:
Create an instance of your modeled Class
Invoke a sequence of methods on that instance that demonstrates the functionality and basic usefulness of what you built.
A String toString() method allowing you to display the state of the Object Instance.
What do we mean by the state of the Instance? The collective value of all data members at a moment in time is considered the instances state. Thats a valid definition of state, but for this lab, customize the Class toString() method to display values of data members that are considered significant to the device/applications operation.
Note: Refer to the Radio Class toString() and main() methods as a guide. Also refer to the Radios execution output below showing that a single instance has been created, and taken through a series of operations (method invocations). At critical points, a toString() representation of the instances state is displayed to the console using System.out.println()or the like.
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
///////////////////////////////////////////////////
follow the lab instruction. thank you. the idea i am working on is a printer so please help me to build its coding. Please dont answer the question unless if you are sure of the answer, this is the fifth time i post the same question. Please read it carefully and answer it.
please dont give me the radio answer. I am building a printer.
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////////////////////////////////
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
