subject

What is the problem in this program; class Main {
public static void main(String[] args) {
String userChoice;

String userName;

double hrsWorked = 0;
double payRate = 0.00;
double taxRate1 = 0.25;
double taxRate2 = 0.50;

double grossPay = 0.00;
double taxAmt = 0.00;
double netPay = 0.00;

scanner in = new scanner( System. in );

System. out. println("Please enter your first name ==> \n");
userName = in. next();

System. out. println("Do you want to compute your net pay? \n");
System. out. println("Enter Y for yes or N for no ==> ");
userChoice = in. next();

if (userChoice. equals("Y")) {
System. out. println("\n Please enter the number of hours you worked ==>");
hrsWorked = in. nextInt();

System. out. println("\n Please enter your pay rate ==> $");
payRate = in. nextFloat();

grossPay = payRate * hrsWorked;

taxAmt = (grossPay >= 500) ? grossPay * taxRate2 : grossPay * taxRate1;

netPay = grossPay - taxAmt;

System. out. println( "\n " + userName + " you said you worked " + hrsWorked + " hours at $" + payRate + "\n");
System. out. println("which means you earned a gross amount of $" + grossPay + " \n");
System. out. println("and you paid $" + taxAmt + " in taxes\n");
System. out. println("so your net pay is $" + netPay + " \n");}
else {System. out. println("\n Thank you " + userName + " then I will not computer your net pay \n");
System. out. println(" Thank you and please come again. \n");
}
}
}
also, this done repl. it PLEASE HELP ASP

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): ‘what is your name? ’ “josh” ‘, josh. what is your favorite color? ’ “green” ‘mine too. do you also like ice cream? ’ “no” ‘josh, how old are you? ’ “40” ‘ and how many siblings do you have? ’’ “3” ‘that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
Answers: 3
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 24.06.2019 22:30
Distinguish between a skill resume and a chronological resume and explain when it is best to use each format
Answers: 1
You know the right answer?
What is the problem in this program; class Main {
public static void main(String[] args) {
Questions
question
Social Studies, 03.02.2020 20:48
question
Mathematics, 03.02.2020 20:48
question
Computers and Technology, 03.02.2020 20:49
Questions on the website: 13722359