Help running a compiled java program
Hello,
I have created the following source code and compiled it in BlueJ version 2.1.3 with java version 1.6.0_01, but I do not know how to run it to be able to test it.
Any help would be appreciated.
import java.text.NumberFormat;
import java.util.Scanner;
import java.util.Locale;
public class PayrollProgram {
public static void main(String[] args)
{
Scanner input = new Scanner( System.in );
NumberFormat usFormat =
NumberFormat.getCurrencyInstance();
String fName;
String lName;
double hourlyRate = 0.0;
int hours = 0;
System.out.printf( "Enter the employee's name (Enter stop when finished): " );
String name = input.next();
while(!name.equals("stop"))
System.out.println("Enter the following info for the employee: ");
System.out.println("First name: ");
fName = input.next();
System.out.println("Last name: ");
lName = input.next();
System.out.printf( "Enter a positive hourly pay rate: " );
hourlyRate = input.nextDouble();
while ( hourlyRate <= 0 )
System.out.printf( "\nHourly rate must be positive: " );
hourlyRate = input.nextDouble();
hourlyRate = Double.parseDouble(input.next());
System.out.println("Hours worked this week.");
hours = Integer.parseInt(input.next());
System.out.println("Here is the employee's info.");
System.out.println("Name: " + fName + " " + lName);
System.out.println("Weekly Pay: " + usFormat.format(hourlyRate * hours));
}
}

