Declaring and Initializing Java Variables
In this lab, you declare and initialize variables in a Java program provided with the data files for this book. The program, which is saved in a fie named NewAge. java, calculates your age in the year 2050.
1. Open the source code file named NewAge. java using Notepad or the text editor of your choice.
2. Declare an integer variable named newAge.
3. Declare and initialize an integer variable named currentAge. Initialize this variable with your current age.
4. Declare and initialize an integer variable named currentYear. Initialize this variable with the value of the current year. Use four digits for the year.
5. Save this source code file in a directory of your choice, and then make that directory your working directory.
6. Compile the source code file NewAge. java.
7. Execute the program. Record the output of this program. _____________________________________________________________________________________ _____________________________________________________________________________________
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.