Question
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
/** Program Name: Problem2
*/
// Import libraries
import java.util.Scanner;
// Beginning of Problem2 Class
public class Problem2
{
private static Scanner stdin;
// Beginning of Main method
public static void main(String[] args)
{
stdin = new Scanner(System.in);
double noOfHrsWrkd=0.0;
double hourlyPayRate=0.0;
double grossAmt=0.0;
double govtDeductAmt=0.0;
double personDeductAmt;
double pensionDeductAmt=0.0;
double totDeductAmt=0.0;
double netPay=0.00;
// Prompting number of hours worked input from keyboard
System.out.print("Enter the number of hours worked: ");
noOfHrsWrkd=stdin.nextDouble();
// Prompting number of hourly pay rate input from keyboard
System.out.print("Enter the pay rate per hour: ");
hourlyPayRate=stdin.nextDouble();
// Calculate gross amount
grossAmt=noOfHrsWrkd*hourlyPayRate...