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

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!