001-002-018
Variable Assignment and Value Overwriting
Medium
Problem Description
variable Assignment and Value Overwriting
In this problem, you will create a program that declares int and String variables, assigns initial values to them, reassigns new values, and displays the value at each stage to standard output.
Learning Objective: Understand how variable assignment and overwriting works
Overview
Create a program that assigns values to variables, overwrites them, and prints the values at each stage.
Specifications
- Declare an
intvariablescoreand assign80 - Print the value of
score - Reassign
95toscore - Print the new value of
score - Assign
"B"to aStringvariablegradeand print - Reassign
"A"togradeand print
Output Format
score: 80
score: 95
grade: B
grade: A
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up