When i go in to add a less than zero code i get a new error
Operator <cant be applied to java.lang.string double if hours worked < 0.0
Please help.. Also if anyone have any advice for someone just starting
java as to a decent beginners book or website.
import java.util.Scanner; // program uses Scanner
public class Payroll
{
// main method begins program execution
public static void main( String args[] )
{
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
// prompt for and input employee name
System.out.println( "Please enter the employee name:" );
String employeeName = input.nextLine(); // read a line of text
System.out.println(); // outputs a blank line
if (employeeName.equals("stop"))
// prompt for and input employee hourly wage
System.out.println( "Please enter the employee hourly wage:" );
String hourlyWage = input.nextLine(); // read a line of text
if ( hourlyWage < 0.0 )
System.out.println( "hourlyWage must be a positive number. Please enter a positive for wage:" );
System.out.println(); // outputs a blank line
// prompt for and input employee hours worked
System.out.println( "Please enter the employee hours worked:" );
String hoursWorked = input.nextLine(); // read a line of text
if ( hoursWorked < 0.0 )
System.out.println( "hoursWorked must be a positive number. Please enter a positive number of hours:" );
System.out.println(); // outputs a blank line
// display person name and hours worked multiplied by hourly wage
System.out.println(employeeName + " $" + (Integer.parseInt(hourlyWage) * Integer.parseInt(hoursWorked)));
} // end main
} // end class Payroll