Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED THIS JAVA PROGRAM IN 2 HOURS PLEASE Write and execute a program in Java using classes and objects that calculates and prints the monthly

NEED THIS JAVA PROGRAM IN 2 HOURS PLEASE

Write and execute a program in Java using classes and objects that calculates and prints the monthly package for an employee. The net pay is calculated after adding all the allowances to and subtracting all the deductions from the gross amount. Note: Assume that OMR refers to Omani Rials Allowances include the following: Housing: 15% of gross amount Transportation: 4% of gross amount Utilities: 6% of gross amount Family: 9% of gross amount Deductions include the following: Medicare: 3% of gross amount Pension or Gratuity: 3% of gross amount Health insurance: OMR 25.00 Formula to calculate the net pay: net pay = gross amount + allowances deductions where allowances = (Housing + transportation + Utilities + Family), and deductions = (Medicare + Pension or Gratuity + Health insurance) Create a class named employee, consisting of the following attributes or instance variables of int type: ? empname // name of employee of type String ? grosspay // gross amount of type double ? housing // housing allowance of type double ? transport // transportation allowance of type double ? utility // utilities allowance of type double ? medicare // medical insurance of type double ? pension // pension of type double ? health // health of type double and constant value of 25.00 Your program should prompt the user to input the gross amount and the employee name. Format your output to have two decimal places.

image text in transcribed

Enter enployee nane: Mo hammed Arif Enter gross pay: Mo hammed Arif Gross Anount:500.0 Housing:75.0 Transportation:20. Utilities:30.0 Fanily:45.0 Medicare:15.0 Pension or Gratuity:15.8 Health Insurance:25.0 et Pay 615.0 Press any key to continue..._

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago