1. You must print two lines of output:
-
- Print
Hello, World.
on the first line. - Print
Hello, Java.
on the second line.
- Print
Output
Hello, World. Hello, Java.
2. Int Data Type
- Create an Integer variable, x, with a value of 10.
- Create another Integer variable, y, with a value of 20.
- Create another Integer variable, result, with a value of x + y.
- Print the result to the shell.
Output
30
3. String Data Type
- Create a String variable, street, with a value of “9127 Ardendale Avenue”.
- Create a String variable, city, with a value of “San Gabriel”
- Create a String variable, state, with a value of “CA”
- Create a String variable, fullAddress, which is a combination of street, city and state variables. Each variable has to be separated with comma.
- Print the result to the shell
Output
9127 Ardendale Avenue, San Gabriel, CA
4. Get Input From User
- Print to shell, “What is your name? “.
- Take user input from the shell and save it to variable fullName.
- Print to the shell combination of “Hi “, fullName, “, welcome to AYCLOGIC.”
- For example if the user enters “John”, then the program will print “Hi John, welcome to AYCLOGIC.”
Output
What is your name? John Hi John welcome to AYCLOGIC.