473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

HELP! i need the finishin codes

Hello is there is any one out there that can help me i just been given this exercise to do and i have done most of it i just need help on alittle bit... The bit i need help on is adding the over time. the Question is is the hours worked has exceeded 40 then the hourly rate must be 1.5 times the normal rate.
If there is anyone that can add this overtime bit in will be greatly appreaciated.
here are the codes that i have done and that are working. This is done in TEXTPAD.

//Rosie Joseph
//J200522635
//This program allows the Employee Name,
// Hours Worked, Hourly Rate and Gross pay be displayed and calculated.

import javax.swing.JOptionPane;

public class CalcPay
{
public static void main (String args [])
{
String Name;
String Hworked;
String HRate;


String output;


int Hours_Worked;
int Rate;



int GrossPay;

Name = JOptionPane.showInputDialog("Enter Your Name:");
Hworked = JOptionPane.showInputDialog("Enter Hours worked in week:");
HRate = JOptionPane.showInputDialog("Enter the hourly Rate:");


Hours_Worked = Integer.parseInt(Hworked);
Rate = Integer.parseInt(HRate);



GrossPay =Hours_Worked * Rate ;


output = "Employee Name: " + Name +
"\nHours Worked in a week: " + Hworked + " hrs "+
"\nHourly Rate : $" + HRate +
"\nThe Gross Pay in a week is $ : " + GrossPay ;


JOptionPane.showMessageDialog(
null, output , "Calculate pay for the week ",
JOptionPane.INFORMATION_MESSAGE);

System.exit(0);

}

}


HELP ME LOL
Nov 1 '06 #1
2 1356
r035198x
13,262 8TB
Hello is there is any one out there that can help me i just been given this exercise to do and i have done most of it i just need help on alittle bit... The bit i need help on is adding the over time. the Question is is the hours worked has exceeded 40 then the hourly rate must be 1.5 times the normal rate.
If there is anyone that can add this overtime bit in will be greatly appreaciated.
here are the codes that i have done and that are working. This is done in TEXTPAD.

//Rosie Joseph
//J200522635
//This program allows the Employee Name,
// Hours Worked, Hourly Rate and Gross pay be displayed and calculated.

import javax.swing.JOptionPane;

public class CalcPay
{
public static void main (String args [])
{
String Name;
String Hworked;
String HRate;


String output;


int Hours_Worked;
int Rate;



int GrossPay;

Name = JOptionPane.showInputDialog("Enter Your Name:");
Hworked = JOptionPane.showInputDialog("Enter Hours worked in week:");
HRate = JOptionPane.showInputDialog("Enter the hourly Rate:");


Hours_Worked = Integer.parseInt(Hworked);
Rate = Integer.parseInt(HRate);



GrossPay =Hours_Worked * Rate ;


output = "Employee Name: " + Name +
"\nHours Worked in a week: " + Hworked + " hrs "+
"\nHourly Rate : $" + HRate +
"\nThe Gross Pay in a week is $ : " + GrossPay ;


JOptionPane.showMessageDialog(
null, output , "Calculate pay for the week ",
JOptionPane.INFORMATION_MESSAGE);

System.exit(0);

}

}


HELP ME LOL
Be more specific if eg 42 hours are worked
is gross 42 * rate * 1.5
or is gross 40 * rate + 2 * rate * 1.5 ?

It's not very clear from your explanation
Nov 1 '06 #2
r035198x
13,262 8TB
Be more specific if eg 42 hours are worked
is gross 42 * rate * 1.5
or is gross 40 * rate + 2 * rate * 1.5 ?

It's not very clear from your explanation
Also rate and gross must be double not int
Nov 1 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
4
by: dixie | last post by:
Help, I'm really out of my depth here (not unusual I hear you say :-). I have just installed HTML Help in an application. I told it in the Project Properties the path to the help file. I then...
9
by: JJ | last post by:
Do you all use HTML help workshop to create your help system. I am finding it quite clumsy to use. Mayeb because I am not used to using it. Do any of you use any other techniques to create help...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.