Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Paraguison, Gabriela Erika S.

BSECE-1

COMPUTER PROGRAMMING

FLOWCHART

Start

Input

String name

int rate

int houseworked

double netpay

double overtimepay

double grosspay

double taxdeduction

double basic pay

double basic pay = 0

System.out.print ("Enter the name: ")

System.out.print ("rate: ")

System.out.print ("Number of hours worked: "


Output

System.out.println ("Basic pay: " + basicpay)

System.out.println ("Overtime pay:" + overtimepay)

System.out.println ("Grosspay: " + grosspay)

System.out.println ("Tax Deduction: " + taxdeduction)

System.out.println ("Net pay: " + netpay);

netpay = grosspay - taxdeduction

System.out.println ("Basic pay: " + basicpay)

System.out.println ("Overtime pay: " + overtimepay)

System.out.println ("Grosspay: " + grosspay)

System.out.println ("Tax Deduction: " + taxdeduction

System.out.println ("Net pay: " + netpay)

System.out.println ("Invalid")

Run the program

End
JAVA CODE

import java.util.Scanner;

public class Payroll_IDNO {

public static void main (String args[]){

Scanner input = new Scanner (System.in);

String name;

int rate;

int hoursworked;

double netpay;

double overtimepay;

double grosspay;

double taxdeduction;

double basicpay = 0;

System.out.print ("Enter the name: ");

name = input.nextLine();

System.out.print ("rate: ");

rate = input.nextInt();

System.out.print ("Number of hours worked: ");

hoursworked = input.nextInt();
if (hoursworked >=0 && hoursworked <=40 ){

basicpay = rate * hoursworked;

overtimepay = 0;

grosspay = basicpay;

taxdeduction = 0;

netpay = basicpay;

System.out.println ("Basic pay: " + basicpay);

System.out.println ("Overtime pay:" + overtimepay);

System.out.println ("Grosspay: " + grosspay);

System.out.println ("Tax Deduction: " + taxdeduction);

System.out.println ("Net pay: " + netpay);

else if (hoursworked >= 41 && hoursworked <=70){

basicpay = rate * 40;

overtimepay = (hoursworked - 40)* rate * 1.5;

grosspay = basicpay + overtimepay;

if (grosspay <=5000){

taxdeduction = 0;}

else if (grosspay >=5000 && grosspay <=9000){

taxdeduction = (grosspay * 0.05);}

else if (grosspay >9000){

taxdeduction = (grosspay * .075);}

else {

taxdeduction = 0;}
netpay = grosspay - taxdeduction;

System.out.println ("Basic pay: " + basicpay);

System.out.println ("Overtime pay: " + overtimepay);

System.out.println ("Grosspay: " + grosspay);

System.out.println ("Tax Deduction: " + taxdeduction);

System.out.println ("Net pay: " + netpay);

else

System.out.println ("Invalid");

}
SCREENSHOTS

You might also like