-
Help with homework2
I have a home work assignment that I am having trouble
with, if anyone could help me in any way that would be
cool. I am not asking you to code it for me. just asking
for tips. because here is what I have so far. And its all screwed
up. I just need some help.
import javax.swing.JOptionPane;
public class salary {
public static void main ( String args [] ){
int item1,
item2,
item3,
item4,
itemCounter = 0,
total = 0;
string itemNumber;
double sum;
itemNumber = Integer.ParseInt(JOptionPane.showInputDialog("Please
enter the Item number (-1 when done):"));
while ( itemNumber != -1 ) {
total = total + itemNumber;
itemCounter = itemCounter + 1;
itemNumber = Integer.ParseInt(JOptionPane.showInputDialog("Please
enter the Item number (-1 when done):"));
switch ( itemNumber ) {
case item1:
}
}
System.exit (0);
}
}
The problem is this: Develop a Java Application that inputs
one salesperson's items sold for the last week and calculates
and displays that salesperson's earnings. There is no limit
to a the number of items sold by a salesperson.
The items are 1 at $239.99, 2 at $129.75, 3 at 99.95, and 4 at 350.89.
The salesperson gets $200.00 plus 9% of the total earnings.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks