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>...
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 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.
can you please create the code program in PYTHON for me. i want to create array...
can you please create the code program in PYTHON for me. i want to create array matrix Nx1 (N is multiple of 4 and start from 16), and matrix has the value of elements like this: if N = 16, matrix is [ 4 4 4 4 -4 -4 -4 -4 4 4 4 4 -4 -4 -4 -4] if N = 64, matrix is [8 8 8 8 8 8 8 8 -8 -8 -8 -8 -8 -8 -8...
Write a program that takes a date as input and outputs the date's season. The input...
Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day. Ex: If the input is: April 11 the output is: Spring In addition, check if the string and int are valid (an actual month and day). Ex: If the input is: Blue 65 the output is: Invalid The dates for each season are: Spring: March 20 - June 20 Summer:...
I need to write an interpreter for arithmetic expressions in Python. This program receives an input...
I need to write an interpreter for arithmetic expressions in Python. This program receives an input string with an arithmetic expression and does: 1. prints a ">>>" as if it was a terminal 2. lets us allocate a variable to a a numeric value (as "a = 3") then it stores {'a':3} to a dictionary memory 3. whenever it receives an expression or input, transform it to postfix notation and print it (even when allocating variables) 4. it is able...
I need to write a program and can't seem to make it run properly. Someone can...
I need to write a program and can't seem to make it run properly. Someone can help with the coding? It's with python Thanks! Here is the program: The rules of Shut the Box are as follows (abbreviated version): + You have two 5-sided die + You have 5 wooden blocks (labeled 1 through 5) + Each turn, you roll the dice and knock down the blocks corresponding to the number on each die + You have to knock down...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT