PROGRAM99 -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; import java.text.*; import java.util.Scanner; import java.lang.*; import java.math.*; import java.lang.String; import java.io.File; public class PROGRAM99 { public static void main(String[] args) throws FileNotFoundException, IOException { Scanner inFile = new Scanner(new FileReader("g:\\payme.txt")); double fed=0.18,st=0.045,hos=25.65,un=7.85; int i,j; String [] ss = new String[15]; String [] name = new String[15]; String [] name2 = new String[15]; String NF,NF1,NF2,NF3,NF4; double [] hr = new double[15]; double [] Hw = new double[15]; double []ovr=new double[15]; double []gr=new double[15]; double []ded=new double[15]; double []net=new double[15]; //Scanner Scanner Console = new Scanner(System.in); System.out.println("Please Enter the Social Security number of the Employee who's record you would like to view"); System.out.println("Ex: ***-**-***"); NF = Console.next(); NF1 = Console.next(); NF2 = Console.next(); NF3 = Console.next(); NF4 = Console.next(); System.out.println("******************************************************
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: **********************************************************"); System.out.println("Social Security# Name Hourly Rate Hourls Worked Overtime Gross Deductions Net "); System.out.println(" Pay Pay Pay "); System.out.println("****************************************************** **********************************************************"); boolean append=true; FileWriter fw = new FileWriter("g:\\payme.txt",append); fw.write(NF+" "); fw.write(NF1+" "); fw.write(NF2+" "); fw.write(NF3+" "); fw.write(NF4+" "); fw.close(); System.out.println(NF); S // Loop for (i=0;i<=14;i++) { // input and stores it in variable name ss[i] = inFile.next(); name [i] = inFile.next(); name2[i] = inFile.next(); hr[i] = inFile.nextDouble(); Hw[i] = inFile.nextDouble(); ovr[i] = (Hw[i] - 40) * (hr[i] + (hr[i]/2.)); gr[i] = (hr[i] * 40) + ovr[i]; ded[i] = (gr[i] * fed) + (gr[i] * st) + hos + un; net[i] = gr[i] - ded[i]; } } }...
View Full Document

Page1 / 2

PROGRAM99 -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online