You are on page 1of 2

IT1708

Hands-on Activity
Selection
Objectives:

At the end of the exercise, the students should be able to:

• Implement decision using one-way, two-way, and multiple selections; and


• Combine conditions using logical operators.

Materials:

▪ NetBeans IDE 8.2


▪ Java Development Kit (JDK) 8

Instructions:

1. Create a folder named LastName_FirstName (ex. Diaz_Jess) on your local drive.

2. Launch NetBeans IDE.

3. Click File > New Project > the New Project window appears.

4. In the New Project window, click the Java category and select Java Application project and click the
Next button.

5. On the Name and Location page, perform the following:

• In the Project Name field, type GrossPayCalculator.

• In the Project Location field, browse and select your folder, then click the Open button.

• Click the Finish button.

6. Write a simple payroll program that will display the employee’s information. The program should perform
the following:

• Ask the user to enter the name of the employee.

• Prompt the user to select between full time and part time by pressing either F (full time) or P
(part time)

• If F is pressed, ask the user to enter his monthly salary. Then display his name and salary.

• If P is pressed, ask the user to type his rate (pay) per hour, the number of hours he worked,
and the numbers of overtime. Then display his name and wage. The computation of overtime
pay is: ℎ𝑜𝑢𝑟𝑠 𝑜𝑓 𝑜𝑣𝑒𝑟𝑡𝑖𝑚𝑒 × (𝑟𝑎𝑡𝑒 𝑝𝑒𝑟 ℎ𝑜𝑢𝑟 × 125%)

• If an invalid letter is pressed, display an error message.

7. Compile and execute the program.

07 Hands-on Activity 1 *Property of STI


Page 1 of 2
IT1708

8. Debug syntax and logical errors if there is any in the program.

9. Save the file.

10. The following is the example output:

Figure 1

Figure 2

GRADING RUBRIC:
CRITERIA PERFORMANCE INDICATORS POINTS
Correctness The code produces the expected result. 30
Logic The code meets the specifications of the problem. 30
Efficiency The code is concise without sacrificing correctness and logic. 20
Syntax The code adheres to the rules of the programming language. 20
Total 100

07 Hands-on Activity 1 *Property of STI


Page 2 of 2

You might also like