What's new

Java GrossPayCalculator

Leinette_Alvarez

Grasshopper
• 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 number 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.
 

Similar threads

Back
Top