Program7 - System.out.println("Social...

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.*; //Jeremy Debruce // 11/12/2007 // Program 7 / public class Program7 { //Declaring of Variables global static double fed=0.18,st=0.045,hos=25.65,un=7.85,hr,Hw,Ovr,gr,ded,net; static String ss,name,name2; static int ch; public static void main(String[] args)throws FileNotFoundException { // Scanner Scanner Console = new Scanner(System.in); //purpose of the program System.out.println("****************************************************") ; System.out.println("*The purpose of the program is to calculate payroll*"); System.out.println("*for The Natural Pine Furniture Comp. using various*"); System.out.println("* selection statements *"); System.out.println("****************************************************") ; System.out.println(); 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("****************************************************** **********************************************************"); //from data file payme Scanner inFile = new Scanner(new FileReader("e:\\payme.txt")); //Loop for(int i=1; i <= 15; i++) { // input of data file and stores it in variable ss = inFile.next(); name = inFile.next(); name2 = inFile.next(); hr = inFile.nextDouble(); Hw = inFile.nextDouble(); Ovr = (hr * 1.5) * (Hw - 40); gr = (hr * 40) + Ovr; ded = (gr * .18) + (gr * .045) + (25.65 + 7.85); net = (gr - ded); //formatting System.out.printf("%-18s%-15s%-12s%5.2f%15.2f%15.2f%10.2f%10.2f%12.2f %n",ss,name,name2,hr,Hw,Ovr,gr,ded,net); }inFile.close(); } }...
View Full Document

Page1 / 2

Program7 - System.out.println("Social...

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