{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Program7 - System.out.println"Social Security Name...

Info icon This 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("****************************************************** **********************************************************");
Image of page 1

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

View Full Document Right Arrow Icon
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

  • Spring '10
  • STAFF
  • Trigraph, ded, static int ch, 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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern