Please write the following program in Java
That last idea at PicoSoft didn't work out too well … management
has a massive public relations disaster on their hands, and thus
they decide to revise the bonus structure, as well as give eveyone
some additional vacation time.
Write a program that reads in (from the keyboard) the following information about an employee:
Last name
First name
Years worked (a whole number)
Annual salary
An employee's vacation time is based upon the following table:
Bonuses are determined by the following table:
Your program should read in the information for an employee, calculate the vacation time and bonus amount for the employee, and display the employee's name, number of years worked, number of weeks of vacation and amount of bonus (on a single line). Please note that you are to print the actual amount of the bonus (calculated as 5% of the annual salary), and not simply the words 5% of salary".
This should be done for eight (8) employee (using a for loop).
Test Run
Enter last name: Weiss
Enter first name: Gerald
Enter years worked: 1
Enter salary: 100
Gerald Weiss gets 1 weeks vacation, and a bonus of $0
Enter last name: Arnow
Enter first name: Davis
Enter years worked: 3
Enter salary: 200
Davis Arnow gets 1 weeks vacation, and a bonus of $0
Enter last name: Tenenbaum
Enter first name: Aaron
Enter years worked: 4
Enter salary: 100
Aaron Tenenbaum gets 2 weeks vacation, and a bonus of $0
Enter last name: Thurm
Enter first name: Joe
Enter years worked: 6
Enter salary: 100
Joe Thurm gets 2 weeks vacation, and a bonus of $200
Enter last name: Whitlock
Enter first name: Paula
Enter years worked: 7
Enter salary: 400
Paula Whitlock gets 3 weeks vacation, and a bonus of $200
Enter last name: Jones
Enter first name: Jackie
Enter years worked: 9
Enter salary: 500
Jackie Jones gets 3 weeks vacation, and a bonus of $200
Enter last name: Dreizen
Enter first name: Phil
Enter years worked: 10
Enter salary: 1000
Phil Dreizen gets 3 weeks vacation, and a bonus of $50
Enter last name: Augenstein
Enter first name: Moshe
Enter years worked: 12
Enter salary: 1500
Moshe Augenstein gets 3 weeks vacation, and a bonus of $75
EmpVacationAndBonus.java
import java.util.Scanner;
public class EmpVacationAndBonus {
public static void main(String[] args) {
// Declaring variables
String lastname, firstname;
int yearsWorked, vacationWeeks = 0;
double bonus = 0, annSal;
/*
* Creating an Scanner class object which is used to get the
inputs
* entered by the user
*/
Scanner sc = new Scanner(System.in);
for (int i = 1; i <= 8; i++) {
// Getting the first name entered by the user
System.out.print("\nEnter last name:");
lastname = sc.next();
// Getting the last name entered by the user
System.out.print("Enter first name:");
firstname = sc.next();
// Getting the no of years entered by the user
System.out.print("Enter years worked:");
yearsWorked = sc.nextInt();
// Getting the annual salary entered by the user
System.out.print("Enter salary:");
annSal = sc.nextDouble();
// based on years worked find the no of vacation weeks and bonus
if (yearsWorked >= 0 && yearsWorked <= 3)
vacationWeeks = 1;
else if (yearsWorked >= 4 && yearsWorked <= 6)
vacationWeeks = 2;
else if (yearsWorked >= 7)
vacationWeeks = 3;
if (yearsWorked >= 0 && yearsWorked <= 4)
bonus = 0;
else if (yearsWorked >= 5 && yearsWorked <= 9)
bonus = 200;
else if (yearsWorked >= 7)
bonus = annSal * 0.05;
// Displaying the output
System.out.println(firstname + " " + lastname + " gets " +
vacationWeeks + " weeks vacation, and a bonus of $" + bonus);
}
}
}
______________________
Output:
Enter last name:Weiss
Enter first name:Gerald
Enter years worked:1
Enter salary:100
Gerald Weiss gets 1 weeks vacation, and a bonus of $0.0
Enter last name:Arnow
Enter first name:Davis
Enter years worked:3
Enter salary:200
Davis Arnow gets 1 weeks vacation, and a bonus of $0.0
Enter last name:Tenenbaum
Enter first name:Aaron
Enter years worked:4
Enter salary:100
Aaron Tenenbaum gets 2 weeks vacation, and a bonus of $0.0
Enter last name:Thurm
Enter first name:Joe
Enter years worked:6
Enter salary:100
Joe Thurm gets 2 weeks vacation, and a bonus of $200.0
Enter last name:Whitlock
Enter first name:Paula
Enter years worked:7
Enter salary:400
Paula Whitlock gets 3 weeks vacation, and a bonus of $200.0
Enter last name: Jones
Enter first name: Jackie
Enter years worked: 9
Enter salary: 500
Jackie Jones gets 3 weeks vacation, and a bonus of $200
Enter last name: Dreizen
Enter first name: Phil
Enter years worked: 10
Enter salary: 1000
Phil Dreizen gets 3 weeks vacation, and a bonus of $50
Enter last name: Augenstein
Enter first name: Moshe
Enter years worked: 12
Enter salary: 1500
Moshe Augenstein gets 3 weeks vacation, and a bonus of $75
_____________Could you rate me well.Plz .Thank You
Please write the following program in Java That last idea at PicoSoft didn't work out too...
Please write in C++ MEMO To: The Programming Staff From The Boss I need a program that will help me figure out who gets what for this year’s annual bonuses. Here are the conditions: Every employee gets a basic bonus of $1000. All the employees in department 2 get an additional $1000 bonus (above the basic bonus) unless they have more than five dependents. Any employee with more than five dependents gets a $5000 bonus. And no – you can’t...
I really need help with this, please. This is a java programming
assignment.
Project 1
The first programming project involves writing a program that
computes the salaries for a collection of employees of different
types. This program consists of four classes.
1. The first class is the Employee class, which contains the
employee's name and monthly salary, which is specified in whole
dollars.
It should have three methods:
a. A constructor that allows the name and monthly salary to be...
Make the following modifications/enhancements to Version 0 of the Phonebook application: The phonebook should now contain a first name as well as a last name. The format of the entries in the file should be: last-name first-name phone-number The lookup process now prompts for both a last and a first name A reverse lookup should also be provided, allowing a name to be obtained by supplying the phone number. Rather than continuing until the user signals end-of-file (at the keyboard),...
In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. Bonuses are calculated based on an employee’s productivity score as shown below. A productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked. Productivity Score Bonus <=30 $50 31–69 $75 70–199 $100 >= 200 $200 Instructions Ensure the file named...
ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...
TAKEN FROM FILE PLEASE I NEED THIS DONE IN HOUR C++ Using this ---- write the functions Abel Herrera 402879 32 Accounting 783.97 4 Eddie Lauren 103938 26 Marketing 9728.23 2 Monica Strauss 110030 29 IT 2368.91 4 Claire Matteo 938928 30 Marketing 1922.12 5 Farida Ahmed 288489 22 IT 88201.67 3 David Masterson 183920 43 Accounting 180.48 1 Chloe Gignac 991229 35 Publishing 912.34 3 William Tucker 410293 51 Accounting 140.19 6 Daniela Moreira 882927 39 Publishing 3192.34 5...
Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...
In excel please show formula of how you got the answer and
equation.
You have the responsibility for making a report to help the company administrators to implement new employee's career plan, providing data to the investment/budget committee. So, you are managing the employee's payroll data from the new division of Data Research, created two years ago to provide the company departments (Marketing, Sales and Operations) with collection/analyze/update/report of real time market information, by making the calculation of their pay...
ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following two problems. Upload your source code files to Canvas. The file names must be of the form coins_your_name.cpp and bonus_your_name.cpp for problems 1 and 2, respectively. Substitute your first and last name for "your_name" in the file name. Problem Statements 1. Given a value V in cents, you need to make change using a minimum number of coins. Assume you have an infinite supply...
Please builed the answer on the fallowing study book text : Types of Termination Payments. Payments made on, or leading up to, the termination of employment are an important part of the process for both the employer and the employee. Employers have obligations either through employment and labour standards laws, collective agreements or organizational policy to ensure that all required payments are made on termination of employment. Employees are obviously concerned that they receive all payments owing to them. Under...