Examlex

Solved

Assuming That a User Enters 45 as the Brightness of a Lamp

question 11

Multiple Choice

Assuming that a user enters 45 as the brightness of a lamp, which of the following hand trace tables is valid for the code below?
Public static void main(String[] args)
{
Int brightness = 0;
Scanner in = new Scanner(System.in) ;
System.out.print(
"Please enter your lamp brightness (in watts) : ") ;
Brightness = in.nextInt() ;
System.out.println("Lamp is " + getDescription(brightness) ) ;
}
Public static String getDescription(int brightness)
{
String description = "";
If (brightness >= 120)
{
Description = "very bright";
If (brightness >= 100)
{
Description = "bright";
}
}
Else
{
Description = "pleasant";
If (brightness <= 50)
{
Description = "dim";
}
}
Return description;
}


Definitions:

Stubborn

Showing determination not to change one's attitude or position on something, especially in spite of good arguments or reasons to do so.

Customary Pricing

Setting prices based on what is traditionally expected or accepted within the market or among competitors.

Cost-plus Pricing

An approach to pricing in which a sale price is established by adding a specific extra amount to the product's per-unit cost.

Target Profit Pricing

Setting a product price based on a predetermined profit objective, rather than market or competitive conditions.

Related Questions