Java Student Project         

Net Pay
Ability Level: Beginner  
Estimated Time: 40 minutes
Objectives:
  • To learn how to use variables and constants.
  • To learn about the int, floating-point, and char data types.
  • To learn how to write arithmetic statements.
  • To learn about the modulus operator. 
Materials & Resources:
  • Java Software
  • Textbook
Overview:
Write a program that calculates the gross pay, withholding tax, and net pay for a worker at Burger King earning $5.50 per hour for 40 hours, for a worker at a school earning $9.50 per hour for 40 hours, and for a programmer earning $75.00 per hour for 40 hours. Display all three salaries. Report the job that pays the best return for the hours worked.
Instructions:


Use the following template to help you get started:
public class netPay
 { 
   public static void main(String args[]) 
    { 
       System.out.println("Program Net Pay");
       .....[code here]
     }
   }

1.  Gross pay is calculated by multiplying hours by rate.
2. Withholding is calculated at 15 percent of gross pay.
3. Net pay is calculated by subtracting withholding from Gross pay.

Hints: Some important points to keep in mind in doing this project:
  1. Variable names usually begin with lowercase letters to distinguish variable names from class names.
  2. You can declare variables at any point within a method prior to their first use. It is common practice to declare variables first and place method calls second.
  3. You can use modulus ( % ) only with integers. All other four operators can be used with floating-point data.
  4. Modulus division returns the remainder of the integer division problem.
  5. An operand is simply any value used in an arithmetic or logical operation.