i know this is easy but i am new to java. We are learning if, else and the while loop in class. I i don't know how to write the "if" part in this problem. So i don't if i need to declare a new string name excellent or something like that.
//****************************************************************************************
//
// Computes the amount of raise and the new
// salary for an employee. The current salary
// and a performance rating (A string: Excellent", "Good" or "Poor") are input.
//****************************************************************************************
import java.util.Scanner;
import java.text.NumberFormat;
public class Salary1
{
public static void main (String[] args)
{
double currentSalary; //employee's current salary
double raise; // amount of the raise
double newSalary; // new salary of the employee
String rating; // performance rating
Scanner scan = new Scanner(System.in);
System.out.print ("Enter the current salary: ");
currentSalary = scan.nextDouble();
System.out.print ("Enter the Performance rating (Excellent, Good, or Poor): ");
rating = scan.next();
// Compute the the raise using if....
newSalary = (currentSalary + raise);
//print the results
NumberFormat money = NumberFormat.getCurrencyInstance();
System.out.println();
System.out.println("Current Salary: " + money.format(currentSalary));
System.out.println("Amount of your raise: " + money.format(raise));
System.out.println("Your new salary: " + money.format(newSalary));
System.out.println();
}
}