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, 03.07.2019 14:10
Line joining liquid phase with liquid and solid phase mixture is known as: a) liquidus b) solidus c) tie line d) none of the mentioned
Answers: 2
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:20
Have a greater impact on maintenance productivity than any other support group. (clo5) a)-the top management b)-inventory and purchasing c)-sub-contracting d)-cmms
Answers: 2
question
Engineering, 04.07.2019 18:20
Along 8-cm diameter steam pipe whose external surface temperature is 900c connects two buildings. the pipe is exposed to ambient air at 70c with a wind speed of 50 km/hr blowing across the pipe. determine the heat loss from the pipe per unit length. (b) air at 500c enters a section of a rectangular duct (15 cm x 20 cm) at an average velocity of 7 m/s. if the walls of the duct are maintained at 100c. a) the length of the tube for an exit temperature of the air to be 40 0c. b)the rate of heat transfer from the air. c) the fan power needed to overcome the pressure drop in this section of the duct.
Answers: 1
You know the right answer?
Lab ObjectivesBe able to declare a new classBe able to write a constructorBe able to write instance...
Questions
question
Social Studies, 19.10.2019 23:50
question
Geography, 19.10.2019 23:50
question
Computers and Technology, 19.10.2019 23:50
Questions on the website: 13722363