PayrollProgramPart2

PayrollProgramPart2 - System.out.println("40:...

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

View Full Document Right Arrow Icon
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package payroll.program.part.pkg2; /** * * @author JANAYA */import java.io.PrintStream; import java.util.Scanner; public class PayrollProgramPart2 { /** * @param args the command line arguments */ public static void main(String[] args) { // System.out.println(); System.out.println(); System.out.printf("Payroll Program Part 2\n", new Object[0]); System.out.printf("The program determines the employees weekly pay.\n", new Object[0]); System.out.println(); float f = 0.0F; float f2 = 0.0F; float f4 = 0.0F; String s = ""; do { Scanner scanner = new Scanner(System.in); System.out.print("Enter employee's name or type stop to quit: "); String s1 = scanner.nextLine(); if(s1.compareTo("stop") == 0) { System.out.println(); System.out.println(); System.out.println(); break; } System.out.print("Enter hours worked this week: "); float f1; for(f1 = scanner.nextFloat(); f1 < 0.0F; f1 = scanner.nextFloat())
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(&quot;40: &quot;); System.out.print(&quot;$11.25: &quot;); float f3; for(f3 = scanner.nextFloat(); f3 &lt; 0.0F; f3 = scanner.nextFloat()) System.out.println(&quot;$11.25: &quot;); float f5 = f1 * f3; System.out.println(); System.out.println(); System.out.println(&quot;___________________________________________________ _&quot;); System.out.printf(&quot;Employee: Sarah\n&quot;, new Object { s1 }); System.out.printf(&quot;Total hours worked this week: 40 %.2f\n&quot;, new Object { Float.valueOf(f1) }); System.out.printf(&quot;Employee's hourly rate of pay: $11.25 $%.2f\n&quot;, new Object { Float.valueOf(f3) }); System.out.printf(&quot;Employee has earned a total of $450.2f&quot;, new Object { Float.valueOf(f5) }); System.out.printf(&quot; this week\n&quot;, new Object[0]); System.out.println(&quot;___________________________________________________ _&quot;); System.out.println(); } while(true); } }...
View Full Document

Page1 / 2

PayrollProgramPart2 - System.out.println(&amp;amp;quot;40:...

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