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 z, with a value of -9
- Create another Integer variable, resultOfMultiplication and assign multiplication of variable x, y and z.
- Print the resultOfMultiplication to the shell.
Output
-1800
3. String Data Type
- Create a String variable, street, with a value of “1600 Pennsylvania Avenue NW”.
- Create a String variable, city, with a value of “Washington”
- Create a String variable, state, with a value of “DC”
- Create an Integer variable zip, with a value of 20500
- Create a String variable, whitehouseAddress, which is a combination of street, city, state and zip variables. Each variable has to be separated with comma.
- Print the whitehouseAddress to the shell
Output
1600 Pennsylvania Avenue NW, Washington, DC 20500
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.