Computes the raise and new salary for an employee

Assignment Help JAVA Programming
Reference no: EM131141707

QUESTION?

Complete the following program to determine the raise and new salary for an employee by adding if ... else statements to compute the raise.

The input to the program includes the current annual salary for the employee and a number indicating the performance rating.

An employee with a rating of 1 will receive a 6% raise, an employee with a rating of 2 will receive a 4% raise, and one with a rating of 3 will receive a 1.5% raise. ? What if no raise is entered?

// Salary.java
// Computes the raise and new salary for an employee
//
import java.util.Scanner;
public class Salary
{
public static void main (String[] args)
{
double currentSalary; // current annual salary
double rating; // performance rating
double raise; // dollar amount of the raise
Scanner scan = new Scanner(System.in);
// Get the current salary and performance rating
System.out.print ("Enter the current salary: ");
currentSalary = scan.nextDouble();
System.out.print ("Enter the performance rating: ");
rating = scan.nextDouble();
// Compute the raise -- Use if ... else ..

// Print the results
System.out.println ("Amount of your raise: tiny_mce_markerquot; + raise);
System.out.println ("Your new salary: tiny_mce_markerquot; + currentSalary + raise);
}
}

Reference no: EM131141707

Questions Cloud

Calculate the square footage of a house : You have begun work at a realty office. You have been asked to develop a program that helps realtors calculate the square footage of a house based on measurements of the rooms of the house
Determine an alternative to arraylists using strings : I am attempting to determine an alternative to ArrayLists using strings and arrays. Additionally, one of the conditions of the assignment is that I have to support using a file (perhaps a comma delimited text file) to populate the vending machine..
Write down a detailed description of the problem : Using the simplified OOD methodology: Write down a detailed description of the problem. Identify all the (relevant) nouns and verbs
Write a java program to accept a day number from the user : Write a Java program to accept a day number from the user and display the corresponding day name by using the if/else construct
Computes the raise and new salary for an employee : Computes the raise and new salary for an employee. Complete the following program to determine the raise and new salary for an employee by adding if ... else statements to compute the raise
Design a class named mydate : Design a class named MyDate. The class contains: The data fields year, month, and day that represesents a date. month is 0-based, i.e., 0 is January. A no-arg constructor that creates a MyDate object for the current date
Calculate the additional amount of sales : The application will now compare the total annual compensation of at least two salespersons. It will calculate the additional amount of sales that each salesperson must achieve to match or exceed the higher of the two earners
Calculate the kilometers : Write a program called MilesToKilometers that converts miles to kilometers. Read the miles value from t he user as a double point value. Calculate the kilometers

Reviews

Write a Review

JAVA Programming Questions & Answers

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create your own unique java application to read all data

Create your own data file consisting of integer, double or String values. Create your own unique Java application to read all data from the file echoing the data to standard output. After all data has been read, display how many data were read

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Circuit for nuclear power plant alarm

Design a circuit for nuclear power plant alarm (slide #2) . Construct a) truth table, b) Boolean expression, c) draw logic circuit, and d) simulate with Multisim (or equivalent) circuit simulation software. Clearly label all inputs and outputs.

  Returns the object with the largest measure

public static Measurable maximum(Measurable[] objects)that returns the object with the largest measure. Use that method to determine the country with the largest area from an array of

  Possible effect that multithreading could have

Imagine you are a graphic artist working on an animation for a movie. Describe at least one (1) possible effect that multithreading could have on your work process. Support your response with at least (1) example of the effect of multithreading

  Rewrittting codes in java

However, I am told the above code would not be written by an experienced Java programmer because the showMessageDialog method is static within the class. How would a pro would write it?

  Design a memory management scheme for a 48 bit architecture

Design a memory management scheme for a 48 bit architecture, using various types of paging and/or segmentation described in this week's readings

  What does the class hierarchy of the applet class look like

My applet runs fine with appletviewer but not in the browser, what can be the problem? What does the class hierarchy of the Applet class look like?

  Information systems to strengthen customer

Which of the following illustrates the use of information systems to strengthen customer and supplier intimacy? BPM is considered concluded when the new processes are both implemented and accepted.

  Class should have a method that returns the average

Write a class named TestScores. The class constructor should accept an array of test scores as its arguments. The class should have a method that returns the average of the test scores.

  Write a program that converts date formats

Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12,..., Z for 35. (Hint: use the case..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd