Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the solution using Java. Question : Annual Pay Suppose an employee get paid every two weeks. In a year the employee get s

I need the solution using Java.

Question: Annual Pay

Suppose an employee get paid every two weeks. In a year the employee get s paid 26 times. Write a program that defines the following variables:

payAmount: This variable will hold the amount of the pay the employee earns each pay period. Your program will ask the user to enter the amount of the pay the employee earn each pay period. (Assume that the employee get the same amount for all pay periods.)

payPeriods: This variable will hold the number of pay periods in a year. Initialize the variable to 26.

annualPay: This variable will hold the employee's total annual pay, which will be calculated.

bonusPay: This variable will hold the employee's bonus based on the total annual pay. Each employee get 5% of the annual pay as his/her bonus pay. This item will be calculated.

totalPay: This variable will hold the total amount of pay the employee earns for the year, which is the sum of the annual pay and the bonus pay.

The program should ask the user to enter the amount of pay the employee earns each pay period. Then the program will calculate the annual pay by multiplying the employee's pay amount by the number of pay periods in a year and store the result in the annualPay variable. The program will then calculate the amount of the bonus by multiplying the annual pay with 5% and store the result in the bonusPay variable. Finally the program will calculate the total pay by adding the annual pay and bonus pay. Display each calculation result.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

Students also viewed these Databases questions