Results 1 to 4 of 4
- 04-24-2011, 10:27 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 2
- Rep Power
- 0
Hi i'm new to java....I need help to finish this calculation,can anyone help me.....
private class pcHandler implements ActionListener
{
public void actionPerformed(ActionEvent arie)
{
if(arie.getSource() == btnCalc)
{
double total = 0.0;
double price = 0.0;
int person = 0;
if(rbA.isSelected())
{
if(cbxA1.isSelected())
{
price = 5.00;
sit = 1;
}
else if(cbxA2.isSelected())
{
price = 5.00;
sit = 1;
}
else if(cbxA3.isSelected())
{
price = 5.00;
sit = 1;
}
}
if(rbB.isSelected())
{
if(cbxA1.isSelected())
{
price = 6.00;
sit = 1;
}
else if(cbxA2.isSelected())
{
price = 6.00;
sit = 1;
}
else if(cbxA3.isSelected())
{
price = 6.00;
sit = 1;
}
}
if(rbC.isSelected())
{
if(cbxA1.isSelected())
{
price = 7.00;
sit = 1;
}
else if(cbxA2.isSelected())
{
price = 7.00;
sit = 1;
}
else if(cbxA3.isSelected())
{
price = 7.00;
sit = 1;
}
}
if(rbD.isSelected())
{
if(cbxA1.isSelected())
{
price = 8.00;
sit = 1;
}
else if(cbxA2.isSelected())
{
price = 8.00;
sit = 1;
}
else if(cbxA3.isSelected())
{
price = 8.00;
sit = 1;
}
}
if(rbE.isSelected())
{
if(cbxA1.isSelected())
{
price = 6.00;
sit = 1;
}
else if(cbxA2.isSelected())
{
price = 6.00;
sit = 1;
}
else if(cbxA3.isSelected())
{
price = 6.00;
sit = 1;
}
}
if(rbF.isSelected())
{
if(cbxA1.isSelected())
{
price = 5.00;
sit = 1;
}
else if(cbxA2.isSelected())
{
price = 5.00;
sit = 1;
}
else if(cbxA3.isSelected())
{
price = 5.00;
sit = 1;
}
}
total = price * person;
txtTicket.setText("RM "+ price);
txtPerson.setText(" "+ person);
txtTP.setText("RM "+ total);
- 04-24-2011, 10:36 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
You didn't do anything but dump your code here, and you only dumped a random chunk.
Also, it's hard to read un formatted code, please wrap it in code tags.
[ code]. No space
YOUR CODE HERE
[/code]
Finally, please ask a specific question. I am lazy, and others may be too, we don't want to spend time finding your small bugs. Please provide use with the necessary information.
Specific questions, exact error messages, etc.
- 04-24-2011, 10:56 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
I think this is a portion of the code from the question asked here. Please keep one thread for one question only.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-24-2011, 11:06 AM #4
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Similar Threads
-
Can anyone help me to complete this java calculation????
By double D in forum New To JavaReplies: 2Last Post: 04-23-2011, 03:27 PM -
how to finish this?
By xpandaxlover in forum New To JavaReplies: 2Last Post: 04-09-2010, 07:43 PM -
Finish Java Application
By ojsimon in forum Jobs OfferedReplies: 8Last Post: 12-07-2009, 04:25 PM -
Need help with doing a calculation in Java
By John D. in forum New To JavaReplies: 6Last Post: 02-24-2009, 11:44 PM -
RSSI calculation using Java Card STK....
By vickytulla in forum Advanced JavaReplies: 0Last Post: 07-14-2008, 08:56 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks