Engineering
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.

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, koolgurl2003
Apump is used to circulate hot water in a home heating system. water enters the well-insulated pump operating at steady state at a rate of 0.42 gal/min. the inlet pressure and temperature are 14.7 lbf/in.2, and 180°f, respectively; at the exit the pressure is 60 lbf/in.2 the pump requires 1/15 hp of power input. water can be modeled as an incompressible substance with constant density of 60.58 lb/ft3 and constant specific heat of 1 btu/lb or. neglecting kinetic and potential energy effects, determine the temperature change, in °r, as the water flows through the pump.
Answers: 1
image
Engineering, 04.07.2019 18:10, settasav9641
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
image
Engineering, 04.07.2019 18:10, Talos02
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
image
Engineering, 04.07.2019 18:10, krystabrewer3
What are the two (02) benefits, which may result from a successful implementation of preventive maintenance (pm) program in an organization? (clo3)a)- lean manufacturing b)-overlapping responsibilities c)-the planner is not qualified d)-accurate contractor information e)-reduction in equipment redundancies f)-accurate stores information
Answers: 3
Do you know the correct answer?
Lab ObjectivesBe able to declare a new classBe able to write a constructorBe able to write instance...

Questions in other subjects: