Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here are some members of a class called Faucet. For each member, specify what ki

ID: 3536421 • Letter: H

Question

Here are some members of a class called Faucet.
For each member, specify what kind of member it is
AND WHY DID YOU PUT THAT MEMBER IN THE GIVEN CATEGORY
either data or function member.
spout
washer
turn on and off
adjust temperature of the water
The valve inside the faucet
The handle of the faucet
adjust the amount of flow of the water.

I can't think of any other members. Can you think of some?
Or can you think of another every day example of a class
and its members?

Another question to consider is
What is the difference between a Faucet class and a Faucet object?

Explanation / Answer

spout - boolean (water can be or can't be flowing)

washer - boolean (can or can't be working properly)

turn on and off - boolean (yes or no)

adjust temperature of the water - float (temperature can have decimal values also)
The valve inside the faucet - boolean (can or can't be working properly)
The handle of the faucet - boolean - (may or may not be turned on)
adjust the amount of flow of the water - char (can be low, medium, or high)

Example:                  Microwave Oven

Temperature Control - char (can be low, medium, or high)

Time - int ( can have any integer value)

Lid - boolean (can be open or close)

Child Lock - boolean (yes or no)

Cooking Completion Indicator - boolean (yes or no)

Difference:

Faucet class is a collection of values of a particular product whereas, faucet object is a particular object of which faucet class defines values.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote