Need help writing Java Code

Hi everyone, I don't know if I am in the right forum, but I am new in writing Java coding and I am confuse on what to do and how to write the code.

I have this question and I just dont know what to do:

How can I write a java code in the following question?

The question:

40 hours normal salary

After the 40 horas, you will pay an addition 1.5 hours

Display the total salary.

how to I write a code for this? Thank you in advance. I know this may be very simple to you but its very hard to me. Thanks again... :)

[560 byte] By [asiandolla] at [2007-10-2 19:03:43]
# 1
Did you check out the tutorials?
BIJ001a at 2007-7-13 20:42:55 > top of Java-index,Developer Tools,Java Compiler...
# 2

> The question:

>

> 40 hours normal salary

> After the 40 horas, you will pay an addition 1.5

> hours

> Display the total salary.

>

> how to I write a code for this?

Do you know how to do it on paper?

Show us.

Then explain the process.

Now write a Java application to do it.

tschodta at 2007-7-13 20:42:55 > top of Java-index,Developer Tools,Java Compiler...
# 3

hi i think this is what your looking for you didnt really make it to clear but here it is anyway hope it helps

class Hours

{

public static void main (String [] args)

{

//declare variables

double hours;

double overtime;

double totalhours;

System.out.println ("Enter hours worked");

hours = Console.readDouble ();

overtime = 1.5;

if (hours > 40)

{

totalhours = overtime + hours;

System.out.println("You are entitled to an additional 1.5 hours");

System.out.println("Your total hours are" + totalhours);

}

else

{

System.out.println ("Total hours worked are " + hours);

}

}//end main

}// End hours

lallypopsa at 2007-7-13 20:42:55 > top of Java-index,Developer Tools,Java Compiler...