Question

In: Computer Science

I need someone to create a program for me: Create a program that takes as input...

I need someone to create a program for me:

Create a program that takes as input an employee's salary and a

rating of the

employee's performance and computes the raise for the employee. The

performance rating here is being entered as a String

the three possible ratings are

"Outstanding",

"Acceptable", and "

Needs Improvement

". An employee who is

rated

outstanding

will receive a

10.2

% raise, one rated

acceptable

will receive a

7

% raise, and one rated

needs improvement

will receive a

1.

2

% raise.

Add the

if... else...

statements to program

Raise

to make i

t run as described above.

Note that you will have to use the

equals

method of the String class (not the

relational operator ==) to compare two strings

.

You should also note how the NumberFormat class from the text package is being

used to format currency i

n this lab.

1.

Create a hand drawn flow chart showing the logic of the if

... else...

statements

2.

Open

P

erformance

R

ating

. Copy and paste the code from this document into

BlueJ.

3.

Add your identifying information to the comments at the top of the code

4.

Finish the code to

execute the if...else and accurately calculate the raise.

5.

Test your code for:

a.

Rating of Outstanding

b.

Rating of Acceptable

c.

Rating of

Needs Improvement

6.

Submit your

.java file

, your flowchart, and your

screenshot

from the BlueJ

terminal window

.

Solutions

Expert Solution

Java Program:

import java.util.*; 
import java.text.NumberFormat;

class Main { 
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        System.out.print("Enter Salary : ");
        double salary = sc.nextDouble();
        sc.nextLine(); // holds the scanner Class to not skip
        System.out.print("Enter Rating : ");
        String rating = sc.nextLine();
        
        double raise = 0;
        NumberFormat nf = NumberFormat.getInstance(Locale.US); // NumberFormat Class
        
        if (rating.equals("Outstanding"))
        {
            raise = (salary * 10.2) / 100;
        }
        else if (rating.equals("Acceptable"))
        {
            raise = (salary * 7) / 100;
        }
        else if (rating.equals("Needs Improvement"))
        {
            raise = (salary * 1.2) / 100;
        }
         
        System.out.println("\nSalary Raise For Employee : "+ nf.format(raise));
        System.out.println("New Salary For Employee : " + nf.format(salary + raise));
    } 
} 

Output:

FlowChart:

Thumbs Up Please !!!


Related Solutions

Directions: Create a program that takes as input an employee's salary and a rating of the...
Directions: Create a program that takes as input an employee's salary and a rating of the employee's performance and then computes the appropriate raise for the employee based on that rating. The performance rating is entered into the program as a String. The three possible ratings are "Outstanding", "Acceptable", and "Needs Improvement". An employee who is rated as Outstanding will receive a 10.2% raise, one rated Acceptable will receive a 7% raise, and one rated as Needs Improvement will receive...
can someone make me a shopping cart for me ? i need to make a shopping...
can someone make me a shopping cart for me ? i need to make a shopping cart ,but i have no idea about how to do this i have made 3 line of items , this is one of the pruduct line line 1 ------------------------------------- <!DOCTYPE html> <html lang="en"> <head> <style> .div1 { border: 2px outset red; background-color: lightblue; text-align: center; } </style> </head> <!-- body --> <body style="background-color:silver; "class="main-layout position_head"> <!-- loader --> </li> </ul> </section> </nav> </section> </header>...
C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Important! Consider which control structures will work best for which aspect of the assignment. For example, which would be the best to use for a menu?...
C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Your code must contain at least one of all of the following control types: nested for() loops a while() or a do-while() loop a switch() statement...
Create the logic for a rhyming program that takes in five words from a user input...
Create the logic for a rhyming program that takes in five words from a user input and replaces the selected rhyming words with the user's input, then creates and displays the Humpty Dumpty rhyme with the five words from the user input. Hint: 1. You will use the sentinel values: start and stop 2. The program will ask the user for 5 words. 3. The program will store the 5 words 4. The program outputs the rhyme replacing the ____...
I need to create a program that will simulate an ATM. The program has to be...
I need to create a program that will simulate an ATM. The program has to be written in JAVA that uses JOptionaPane to pop up the messages. It will need to simulate to get ** balance **withdraw **Deposit **exit the atm ** need to have a method that shows a receipt of everything that was done during the transaction
I need someone to clarify one confusion to me , its regarding operations management. can someone...
I need someone to clarify one confusion to me , its regarding operations management. can someone explain the 3 strategies in aggregate capacity management in alot of details ( like 500 words) so I can understand about it more. the three strategies are (level, hybrid, and chase)
I need someone to describe these topics to me as the web makes it confusing. Thank...
I need someone to describe these topics to me as the web makes it confusing. Thank you. Money and financial banking. Monetary policy. The federal reserve. Functions of the federal reserve.
please i need from someone to do for me a English documented research essay on the...
please i need from someone to do for me a English documented research essay on the causes of the Lebanese economic crisis it should be composed from: introduction, body 1 , body 2 , body 3, rebuttal, conclusion, links of articles that have be used to get information.
Hello i need someone to implement for me RADIX SORT IN JAVA for Characters NOT numbers...
Hello i need someone to implement for me RADIX SORT IN JAVA for Characters NOT numbers and i need the code super fast please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT