lab3-3 - // Write your code here. employeeBonus = 0;

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// Lab3_3.java - This program calculates an employee's yearly bonus. import javax.swing.*; public class Lab3_3 { public static void main(String args[]) { // Declare and initialize variables here. String employeeName; String salaryString; double employeeSalary; String ratingString; int employeeRating; double employeeBonus; employeeName = JOptionPane.showInputDialog("Enter employee's name: "); salaryString = JOptionPane.showInputDialog("Enter employee's yearly salary: "); ratingString = JOptionPane.showInputDialog("Enter employee's performance rating: "); employeeSalary = Double.parseDouble(salaryString); employeeRating = Integer.parseInt(ratingString);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Write your code here. employeeBonus = 0; if(ratingString.equals("1")) employeeBonus = employeeSalary * .06; else if(ratingString.equals("2")) employeeBonus = employeeSalary * .04; else if(ratingString.equals("3")) employeeBonus = employeeSalary * .02; else if(ratingString.equals("4")) employeeBonus = employeeSalary * 0; // Output. System.out.println("Employee Name " + employeeName); System.out.println("Employee Salary $" + employeeSalary); System.out.println("Employee Rating " + employeeRating); System.out.println("Employee Bonus $" + employeeBonus); System.exit(0); } }...
View Full Document

This note was uploaded on 04/30/2008 for the course MNGT 3040 taught by Professor Landrum during the Fall '08 term at Auburn University.

Page1 / 2

lab3-3 - // Write your code here. employeeBonus = 0;

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online