Wage Calculator
I am very new to any type of programming. I am to write a simple program that calculates wages using user input of hourly wage and hours worked. Can anyone tell me what I have done wrong here?
(code)
// Wage.java
//Java payroll program
import java.util.Scanner;
public class Wage
{
public static void main( String args [] )
{
Scanner input = new Scanner( System.in );
double x; // name
double y = 0.0; // hourly wage
double z = 0.0; // hours worked
double a = 0.0; // pay
System.out.print("Please Enter Employees Name:");
x = input.nextDouble();
System.out.println("Please Enter Hourly Wage:");
y = input.nextDouble();
System.out.println("Please Enter Hours Worked:");
z = input.nextDouble();
a = y * z;
System.out.printf( "Employee: %s\n", x );
System.out.printf( "Total pay for this period is $ %d\n", a);
}//end main method
}//end public class TomKinney1
(end code).
It compiles but I get java.util.InputMismatchException after I enter the name.

