Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Q.2.6 What does the following code output? int x = 5; do { System.out.println(x)

ID: 3902666 • Letter: Q

Question

Q.2.6 What does the following code output?

int x = 5;

do

{

System.out.println(x);

x--;

}while (x >= 3);

Q.3.1 in java Write a piece of code that declares an instance of the Employee class and name it Employee1 pass the following parameters for the Employee class constructor:

? Firstnme = “John”

? Lastname = “Smith”

? Hourly Rate = 25

? Gender = “Male”

Q.3.2 Write a piece of code that declares a variable with the relevant data type and receives its values from the overtimeHourlyRate() method of the Employee class, use the declared class instance.

Q.3.3 Write a piece of code that declares a variable with the relevant data type and receives its values from the overtimeHours () method of the Employee class, use the declared class instance. Pass the hoursWorkedDuringAWeek parameter value as 15.

Q.3.4 Write a piece of code that declares a variable with the relevant data type and receives its values from the computeSalary () method of the Employee class, use the declared class instance. Pass the hoursWorkedDuringAWeek parameter value as 20.

Q.2.4 Write the statement to declare a constant named PRICE_PER_PERSON with the value of 125.95 assigned to it.

Q.2.7 What does the following code output1?

a = 2;

do

{

System.out.print(a + " ");

a++;

} while (a < 2);

(2)

all in java

Explanation / Answer

Hi. please find the answer above.. i have given comments so that it is very easy for you to understand the flow. In case of any doubts, please ask in comments. If the answer helps you, please upvote. Thanks!