Java+Project+1

/** PaymentCalculator.java Calculates your daily earnings, weekly earnings, and tells you if you are making more or less than projected salary. *

** @author  **  Nick Hazel

*/ import

java.util.Scanner;

public

** class  ** PaymentCalculator {

** public  ****  static  ****  void  ** main(String[] args) {

System.

// out  //.print(  "How many hours did you work?"  );

Scanner keyboard =

** new  ** Scanner(System.//  in  //);  //JAVA 1.5 or later.

** double  ** hours = keyboard.nextDouble;  //Makes program recognize next typed item is hours.

System.

// out  //.print(  "What is your hourly wage?"  );

** double  ** dollarsPerHour = keyboard.nextDouble;  //Makes program recognize next typed item is dollarsPerHour.

** double  ** payment = hours * dollarsPerHour;  //Calculates daily payment by multiplying hours times dollarsPerHour.

System.

// out  //.print(  " You made $"  + payment );

System.

// out  //.print(  "How many days do you work a week?"  );

** double  ** days = keyboard.nextDouble;  //Makes program recognize next typed item as days.

** double  ** weeklyWage = payment * days;  //Calculates your weekly wage by multiplying payment times days.

System.

// out  //.print(  "At this rate you will make $"  + weeklyWage +  " this week."  );

System.

// out  //.print(  "How many weeks do you work a year?"  );

** double  ** weeksPerYear = keyboard.nextDouble;  //Makes program recognize next typed item as weeksPerYear.

** double  ** yearlyWage = weeksPerYear * weeklyWage;  //Calculates yearly wage by multiplying weeklyWage times weeksPerYear.

System.

// out  //.print(  "At this rate you will make $"  + yearlyWage +  " this year"  );

System.

// out  //.print(  "What is your estimated salary?"  );

** double  ** salary = keyboard.nextDouble;  //Makes program recognize next typed item as salary.

** double  ** salaryAccuracy = yearlyWage - salary;  //Calculates if you are on the right track to your projected salary.

System.

// out  //.print(  "You are making $"  + salaryAccuracy +  " different from your salary."  );

** if  ** (salaryAccuracy > 0) {

System.

// out  //.print(  "You are on the right track. Keep it up!"  );

}

** else  ** {

System.

// out  //.print(  " You need to pick up the pace because you are falling behind."  );

} }  }