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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started