Examlex

Solved

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

question 23

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 given code snippet?
Int brightness = 0;
String description = "";
Scanner in = new Scanner(System.in) ;
System.out.print("Enter your lamp brightness (in watts) : ") ;
Brightness = in.nextInt() ;
If (brightness >= 120)
{
Description = "very bright";
If (brightness >= 100)
{
Description = "bright";
}
}
Else
{
Description = "pleasant";
If (brightness <= 50)
{
Description = "dim";
}
}


Definitions:

Résumé

A document presenting a person's background, skills, and accomplishments, used as part of a job application.

Cover Message

A correspondence that accompanies another document, such as a resume or report, providing context or additional information.

E-mail

A method of exchanging digital messages over the internet between individuals using electronic devices.

Cover Message

A brief communication that accompanies or introduces another document or message, often providing context or additional information.

Related Questions