Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions

Question

=+What sanctions are available to employers

Answered: 1 week ago

Question

=+ If strikes occur, are they legally regulated?

Answered: 1 week ago

Question

=+industrial action Under what circumstances can unions strike?

Answered: 1 week ago