# Thread: Really New Here can someone help me??

1. Member
Join Date
Sep 2014
Posts
1
Rep Power
0

## Really New Here can someone help me??

HERE IS THE PROBLEM:
the pay rate is php 35.00 per hour. any hours worked after 40 hours is paid at rate of 2 times the normal hourly rate. Calculate and display the Normal Pay, The overtime pay, and the total pay.

and can u please give me a code that any number(hours) you will put will be accepted on my

OUTPUT MUST BE:
Sample 1
Enter Hours Worked: 40 (Sample)
Normal Pay: 1400 (Sample)
Overtime Pay: 0 (Sample)
Total Pay: 1400 (Sample)

Sample 2
Enter Hours Worked: 41 (Sample)
Normal Pay: 1400 (Sample)
Overtime Pay: 70 (Sample)
Total Pay: 1470 (Sample)

here is my code or something, but i cant finish it. or dont know what to do next. can someone help me?? or i dont know what will i put. :/

================================================== =========================

import java.util.Scanner;
public class Workpay {

public static void main(String[]args) {
Scanner in = new Scanner (System.in);
int hours;
int normalpay = 35;
int overtimepay = 2;
System.out.print("Enter Hours Worked: ");
hours = in.nextInt();

if (hours == 40)
System.out.println("Normal Pay: "+hours*np); <<<< ?? HELP ??
System.out.println("Overtime Pay: "); <<<< ?? HELP ??
System.out.println("Total Pay: "); <<< ?? HELP ??
else
DIDNT FISH THIS PART <<< ?? HELP ??

}

}

================================================== =========================

Last edited by Winter; 09-12-2014 at 12:35 PM.

2. ## Re: Really New Here can someone help me??

Do you have any specific questions about the code?

One problem I see is the code doesn't use {} to surround blocks of code inside of the if statement.

[code]
[/code]
to get highlighting and preserve formatting.

3. Senior Member
Join Date
Oct 2010
Posts
393
Rep Power
9

## Re: Really New Here can someone help me??

Hi Winter, welcome.

Forget about that if statement for now. Regardless of the hours worked you still want to print out all of the pay information.
The only condition under which you will see normal pay is if the hours equal 40. The other lines are dispayed regardless. You will need to work out the hours worked over the 40 to calculate the overtime pay so this would likely need an if statement here.

Regards.

4. Member
Join Date
Sep 2014
Posts
1
Rep Power
0

## Re: Really New Here can someone help me??

Hey Winter, I'm brand new to Java myself, I started last Friday. I thought I would go ahead and get my feet wet though as the both of the books I am reading suggest joining forums. Besides the general formatting errors, which your IDE should help you with, I needed a few more variables to get a working program, or class, I am not really sure what the correct term would be. Anyways, that's where I would start. Best of luck!