Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is what I have so far ************************************************************ Enter Employee's name: Dave Smith Enter number of hours worked in a week:10 Enter hourly pay rate:

Here is what I have so far ************************************************************ Enter Employee's name: Dave Smith Enter number of hours worked in a week:10 Enter hourly pay rate: 6.75 Enter federal tax withholding rate: 0.20 Enter state tax withholding rate: 0.09 ************************************************************/ import java.util.*; fun main(args: Array) { val sc = Scanner(System.`in`) print("Enter Employee's name: ") var name = sc.nextLine() print("Enter number of hours worked in a week:") var noHours = sc.nextFloat() print("Enter hourly pay rate: ") var rate = sc.nextFloat() print("Enter federal tax withholding rate: ") var tax = sc.nextFloat() print("Enter state tax withholding rate: ") var stTax = sc.nextFloat() var gross = noHours * rate println("Employee Name: " + name) println("Hours worked: " + noHours) println("Pay Rate: " + rate) println("Gross Pay: " + gross) var fedWith = tax * gross var stWith = stTax * gross println("Deductions: ") println("\t Federal widthholding (${tax * 100}") println("\t Total Dedcution: {gross-stWith-fedWith}") }

Enter Employee's name: Dave Smith Enter number of hours worked in a week: 10 Enter hourly pay rate: 6.75 Enter federal tax withholding rate: 0.20 Enter state tax withholding rate: 0.09 Employee Name: Dave Smith Hours worked: 10.0 Pay Rate: 6.75 Gross Pay: 67.5 Deductions: Federal widthholding (20.0 Total Dedcution: {gross-stWith-fedWith}

but I am trying i cant seem to figure out how to get the following below to show up on my output

Deductions: Federal Withholding (20.0%): $13.50 State Withholding (9.0%): $6.07 Total Deduction: $19.57 Net Pay: $47.92

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books