View Single Post
  #1 (permalink)  
Old 07-24-2007, 06:25 AM
lenny lenny is offline
Member
 
Join Date: Jul 2007
Posts: 40
lenny is on a distinguished road
int and String, help me
Hi, I'm making this class to take a customer's order for a project, but I hit a snag. Basically I'm asking a customer for the amount of pizzas they want, then the size, the first topping, and the last topping.
The amount of pizzas they want will initiate the amount of times my "for loop" will run to ask the same round of questions.

for the size of the pizzas, I've assigned (1)small (2)medium (3)large. The customer enters the respective number, and i take the input as

Code:
int size=JOptionpane.showInputDialog("Whats the size?(1)small(2)medium(3)large" )
I'll get a int number between 1-3, but now how do i assign a string value to an integer?

like how do i get the input of "1" to mean "small"?

Thanks
Reply With Quote
Sponsored Links