Examlex

Solved

Create a Switch Statement That Will Test the Value of a Variable

question 30

Essay

Create a switch statement that will test the value of a variable named score . If score has a value of 5, create a println statement that will output "Excellent". If score has a value of 4, create a println statement that will output "Great". If score has a value of 3, create a println statement that will output "Good". If score has a value of 2, create a println statement that will output "Fair". If score has a value of 1, create a println statement that will output "Needs improvement". If score does not contain a matching value for any of the case statements, create a println statement that will output "Retake test".


Definitions:

Working Memory

A cognitive system that holds and manipulates information in short-term memory for tasks such as reasoning and comprehension.

Long-term Memory

The aspect of memory responsible for storing information over extended periods, potentially throughout a person’s life.

Retrograde Amnesia

A loss of memory-access to events that occurred, or information that was learned, before an injury or the onset of a disease.

Explicit Memory

Memory in which there is conscious recall of facts and events.

Related Questions