-
Using a Switch Statement
Hi im new to Java and looking for some guidance.
Im trying to write a program that reads a series of pairs of numbers for a product and the quantity sold for the day. I think i have to have to ask the user 7 times for each product and then add the product up for the week. I have to use a switch statement so ive just started on that part so far, not sure if it is right. So i have 5 products and their prices. Is this the best place to start. Thanks.
products
int price = 0;
switch (products) {
case 1: price = $2
break;
case 2: price = $4
break;
case 3: price = $6
break;
case 4: price = $8
break;
case 5: price = $10
break;
-
You havent expalined your question very well?
Can you word it any differently?
-
Thanks for replying, got someone to explain it better to me so i got it done today. Thanks.
-
 Originally Posted by ShanD
Thanks for replying, got someone to explain it better to me so i got it done today. Thanks. 
LOL..
No problems, you hardly expalined your problem very well!
Anyway, glad your good to go..
Similar Threads
-
By stormswimmer in forum Java
Replies: 7
Last Post: 12-27-2005, 09:29 AM
-
Replies: 3
Last Post: 11-01-2005, 09:48 AM
-
By Daryl Shockey in forum Database
Replies: 2
Last Post: 05-28-2002, 03:50 PM
-
By Saiful in forum VB Classic
Replies: 7
Last Post: 11-24-2000, 05:21 AM
-
By James Lin in forum .NET
Replies: 9
Last Post: 08-15-2000, 10:54 AM
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
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|