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, 22.06.2019 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 22.06.2019 07:30
Jasper and samantha are in a robotics competition. the guidelines state that the robots should be able to move a 10-gram weight at least 2 meters and turn in a circle. jasper and samantha have already built the robot. which step of the design process should they follow next to decide whether their robot meets the minimum criteria for the competition?
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
In excel, what happens to the cell contents when you click and drag a cell into multiple cells?
Answers: 1
You know the right answer?
What is the problem in this program; class Main {
public static void main(String[] args) {
Questions
question
Mathematics, 28.06.2021 02:30
question
Mathematics, 28.06.2021 02:30
question
Mathematics, 28.06.2021 02:30
question
Physics, 28.06.2021 02:40
question
Mathematics, 28.06.2021 02:40
Questions on the website: 13722367