logo CodeStepByStep logo

variableSyntax

Language/Type: Java expressions variables

Answer each of the following multiple-choice questions:

Which of the following choices is the correct syntax for declaring a real number variable named grade and initializing its value to 4.0?
(order shuffled)
Suppose you have a variable named grade, set to 1.6, and later in the program's code you want to change the value of grade to 4.0. Which is the correct syntax to do this?
(order shuffled)
Suppose you have a variable named balance, set to 463.23. Later in the program's code, we want to add 5 to the balance. Which is a correct statement to do this?
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.