Declare five integer numbers adds the five integers and


Q1. Write a Java program that does the following

1. Declare five integer numbers

2. Print the five numbers at the same line

3. Adds the five integers and store the results in variable sum

4. Calculate the average of the five numbers

5. Print the sum and average of the five numbers

Q2. Write a Java statements that accomplish the following

1. declare int variables x, y

1. initialize the variable x to 10

2. update the value of variable x by adding 5 to it and copy the value of x into y

3. declare and initialize a double variable Rate to 25.50, a char variableGender to ‘M' and a string variable str to "Hello"

4. update the value of variable by concatenating it to Gender and then to x

5. Output the contents of x, y, Gender and str.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Declare five integer numbers adds the five integers and
Reference No:- TGS01031002

Expected delivery within 24 Hours