I cant get "\nNet Pay: " + netPay(dGrossPay, dRetirement)); to display anything other than 0.0.
I know I need to assign a value to dGrossPay but im not sure how to.

public int menu()
		{
		Scanner keyboard = new Scanner(System.in);
		String strUserName;
		double dHours;
		double dRate;
		double dGross = 0.0;
		double dRetirement;
		double dNetPay = 0.0;
		int iChoice;
		double dGrade = 0.0;
		double dGrossPay = 0.0;
		System.out.print("\n\t\tMENU"
					   + "\n1>	Calculate and display grade point average and letter grade"
					   + "\n2>	Find the maximum of three integers and display result"
					   + "\n3>	Find Gross Pay and net pay and display results"
					   + "\n4>	Terminate Program"
					   + "\n\nWhich is your choice? ");
			iChoice = keyboard.nextInt();
			switch(iChoice)
			{
			case 1:
					calcGradeAverage();
					System.out.println(calcLetter(dGrade));
					break;
			case 2:
					findMax();
					break;
			case 3:
				keyboard.nextLine();
				System.out.print("Enter you name: ");
				strUserName = keyboard.nextLine();
				System.out.print("Enter hours worked: ");
				dHours = keyboard.nextDouble();
				System.out.print("Enter your payrate: ");
				dRate = keyboard.nextDouble();
				System.out.print("How much would you like to set aside for retirement: ");
				dRetirement = keyboard.nextDouble();
				grossPay(dHours, dRate);
				//netPay(dGrossPay, dRetirement);
				System.out.print("\nName:        " + strUserName
							   + "\nHours:       " + dHours
							   + "\nRate:        " + dRate
							   + "\nGross:       " + grossPay(dHours, dRate)
							   + "\nRetirement:  " + dRetirement
							   + "\nNet Pay:     " + netPay(dGrossPay, dRetirement));
					break;
					
			case 4:
				
			default:
					System.out.println("That choice is not valid.");
			}//end switch(iChoice)
			return iChoice;
		}//end menu
public double grossPay(double dHours, double dRate)
		{
			double dGross;	//holds the gross pay
			if(dHours < 40)
				dGross = dHours * dRate;
			else
				dGross = (1.5 * dRate) * (dHours-40) + (dRate*40);
			return dGross;
		}//end grossPay(double dHours, double dRate)
		
		public double netPay(double dGrossPay, double dRetirement)
		{
			double dTax;
			double dNetPay;
						
			if(dGrossPay > 10000)
				{
				dTax = .30;
				}
			else if(dGrossPay <= 10000 && dGrossPay > 7000)
				{
				dTax = .25;
				}
			else if(dGrossPay <= 7000 && dGrossPay > 6000)
				{
				dTax = .20;
				}
			else if(dGrossPay <= 6000 && dGrossPay > 4000)
				{
				dTax = .15;
				}
			else if(dGrossPay <= 4000 && dGrossPay > 2000)
				{
				dTax = .10;
				}
			else if(dGrossPay <= 2000 && dGrossPay > 1000)
				{
				dTax = .5;
				}
			else if(dGrossPay <= 1000)
				{
				dTax = 0;
				}
			dNetPay = dGrossPay - dGrossPay * .07;
			return dNetPay;
		}//end netPay(double dGrossPay, double dRetirement)

Aren't you suppose to do this:

dRetirement = keyboard.nextDouble();
[B]dGrossPay = [/B]grossPay(dHours, dRate);
//netPay(dGrossPay, dRetirement);

Instead of this?

dRetirement = keyboard.nextDouble();
grossPay(dHours, dRate);
//netPay(dGrossPay, dRetirement);

Yes. Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.