I wrote a bit of code at school using a copy of Net Beans that they have installed on the computers in the lab at my school. I saved my file to my thumb drive as Lab2.Java.
When I got home I opened my copy of Net Beans 7.0.1 and then opened my saved file on my thimb drive (Lab2.Java). Only to find that once the file is opened in Net Beans it will not RUN.
It is a simple bit of code. Can someone please give me there input as to why I can't get this to RUN.
The CODE is below. Thanks all.
import java.text.*;
import javax.swing.JOptionPane;
public class Lab2 {
public static void main(String[] args) {
System.out.println("Welcome to the Payroll System!");
String strName = JOptionPane.showInputDialog("Please Enter your Name");
Double hrsWork = Double.parseDouble(JOptionPane.showInputDialog("Please Enter Hours Worked"));
Double hrRate = Double.parseDouble(JOptionPane.showInputDialog("Please Enter your Hourly Rate"));
Double fedTax = Double.parseDouble(JOptionPane.showInputDialog("Please Enter Federal Tax Withholding"));
Double staTax = Double.parseDouble(JOptionPane.showInputDialog("Please Enter State Tax Rate"));
Double grossPay = hrsWork * hrRate;
Double fedWith = grossPay * fedTax;
Double stateWith = grossPay * staTax;
Double totalDeduction = fedWith + stateWith;
Double netPay = grossPay - totalDeduction;
DecimalFormat df = new DecimalFormat("#.##");
String Capture = "Employee Name: " + strName + "\n \n \r"
+ "Hours Worked" + df.format(hrsWork) + "\n \r"
+ "Pay Rate" + df.format(hrRate) + "\n \r"
+ "Gross Pay" + df.format(grossPay) + "\n \r"
+ "Deductions" + "\n \r"
+ "\t" + "Fedral Withholding: " + (fedTax * 100) + ": " + df.format(fedWith) + "\n \r"
+ "\t" + "State Withholding: " + (staTax * 100) + ": " + df.format(stateWith) + "\n \r"
+ "\t" + "Total Deductions: " + df.format(totalDeduction) + "\n \r"
+ "Net Pay" + df.format(netPay) + "\n \r";
JOptionPane.showMessageDialog(null, Capture);