473,802 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP! i need the finishin codes

1 New Member
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.JOp tionPane;

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.sho wInputDialog("E nter Your Name:");
Hworked = JOptionPane.sho wInputDialog("E nter Hours worked in week:");
HRate = JOptionPane.sho wInputDialog("E nter the hourly Rate:");


Hours_Worked = Integer.parseIn t(Hworked);
Rate = Integer.parseIn t(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.sho wMessageDialog(
null, output , "Calculate pay for the week ",
JOptionPane.INF ORMATION_MESSAG E);

System.exit(0);

}

}


HELP ME LOL
Nov 1 '06 #1
2 1381
r035198x
13,262 MVP
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.JOp tionPane;

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.sho wInputDialog("E nter Your Name:");
Hworked = JOptionPane.sho wInputDialog("E nter Hours worked in week:");
HRate = JOptionPane.sho wInputDialog("E nter the hourly Rate:");


Hours_Worked = Integer.parseIn t(Hworked);
Rate = Integer.parseIn t(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.sho wMessageDialog(
null, output , "Calculate pay for the week ",
JOptionPane.INF ORMATION_MESSAG E);

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 MVP
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
6565
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 Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to reformatting my system. Prior to the reformatting, I copied the help.rtf file onto a CD and checked the box to...
9
4419
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 the microsoft HTML workshop utility, lets call it c:\path\help.chm. My question is how do you launch it from the GUI? What logic do I put behind the "help" button, in other words. I thought it would be os.spawnv(os.P_DETACH,...
4
3358
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 cmd.Cmd but I would also like to get the man-page-like help for classes and functions. Does anyone know how to do that? Thanks. Sarir
2
6488
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
3027
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 an html authoring tool to help you accomplish? 2. What do you expect from online help for a html authoring tool? 3. What audience do you think a freeware html authoring tool is directed towards?
3
3369
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 numarray, help gives unhelpful responses:
4
2639
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 type in a command line that runs the help in the correct Context from a button on each form. It all worked fine - HERE. The problem is that when I sent it out to a site, the help file was not able to be accessed because it was my path in the...
9
2252
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 for your progs? Whats the current popular approach to creating help? I am only wanting a straight help file accessible from a menu - no context sensitive stuff. TIA
8
3238
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 including search the internet for help, but the help is worthless. Any ideas?
0
2898
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 calls MS Excel, so the scenario is that I am supposed to see the Excel Menu bar, FILE EDIT VIEW INSERT ... HELP. I am able to see the menu bar, but in case of Help, I see the Help of Excel and help of my application, both as a submenu of help. ...
0
10536
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10304
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9114
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.