OBJECT ORIENTED PROGRAMMING
LABORATORY – 3
----------------------------------------------------------------------------------
Problem#1: Write a Java program that reads three integers from
the user and checks if all three numbers are equal. The program
should display a message indicating whether the numbers are
equal or not.
Sample Output:
Enter the first integer: 9
Enter the second integer: 13
Enter the third integer: 5
The numbers are not equal.
Enter the first integer: 6
Enter the second integer: 6
Enter the third integer: 6
All three numbers are equal.
Problem#2: Write a Java program that takes the job title and
current hourly fare from the user and calculates the new hourly
fare based on the following table.
Job Title Fare Increase Percentage
Developer %10
Designer %5
Analyst %18
Tester %7
Support %12
Example:
Input:
Enter your job title: Analyst
Enter your current hourly fare: 21
Output:
New hourly fare: 24.7
Hints:
• You can use the following equation to find the new hourly fare:
newFare = currentFare + (currentFare * farePercentage / 100)
• use equalsIgnoreCase() method with the Job Titles’ variables to
avoid case sensitivity when comparing strings.