subject
Engineering, 28.02.2020 23:30 Leanylopez0811

Lab ObjectivesBe able to declare a new classBe able to write a constructorBe able to write instance methods that return a valueBe able to instantiate an objectBe able to use calls to instance methods to access a change the state of an is familiar with a television. It is the object we are going to create in this lab. First we need a blueprint. All manufacturers have the same basic elements in the televisions they produce as well as many options. We are going to work with a few basic elements that are common to all televisions. Think about a television in general. It has a brand name (i. e. it is made by a specific manufacturer). The television screen has a specific size. It has some basic controls. There is a control to turn the power on and off. There is a control to change the channel. There is also a control for the volume. At any point in time, the television’s state can be described by how these controls are set. We will write the Television class. Each object that is created from the Television class must be able to hold information about that instance of aTelevision in fields. So a Television object will have the following attributes:< >. The manufacturer attribute will hold the brand name. This cannot change once the television is created, so will be a named constant.< >. The screenSize attribute will hold the size of the television screen.< >. The powerOn attribute will hold the value true if the power is on and false if the power is off.< >. The channel attribute will hold the value of the station that the television is showing.< >. The volume attribute will hold a number value representing the loudness (0 being no sound).The Television object will also be able to control the state of its attributes. These controls become methods in our class.< >. The setChannel method will store the desired station in the channel field.< >. The power method will toggle the power between on and off, changing the value stored in the powerOn field from true to false or from false to true.< >. The increaseVolume method will increase the value stored in the volume field by 1.< >. The decreaseVolume method will decrease the value stored in the volume field by 1.< >. The getChannel method will return the value stored in the channel field.< >. The getVolume method will return the value stored in the volume field.< >. The getManufacturer method will return the constant value stored in the MANUFACTURER field.• getScreenSize. The getScreenSize method will return the constant value stored in the SCREEN_SIZE field. We will also need a constructor method that will be used to create an instance of aTelevision.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
Answers: 3
question
Engineering, 04.07.2019 18:20
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
You know the right answer?
Lab ObjectivesBe able to declare a new classBe able to write a constructorBe able to write instance...
Questions
question
English, 17.09.2019 18:30
question
Mathematics, 17.09.2019 18:30
Questions on the website: 13722360