2nd loop combined the first and second statement lines...why?
I wrote this program to calculate the price. I want to have users to enter the item name and price continuesly, then once the hit 'f', it will give them the total. I was able to enter the first item and price but then the second time around, this is what show on my screen:
Item to purchase (enter F when finished): price for this is:
It combined the first and second lines in one line. I can't figure out why.
Please help.
This is part of my code below:
for (;;)
{
String F ="F";
System.out.print("Item to purchase (enter F when finished): ");
item=sc.nextLine();
if(item.equalsIgnoreCase (F))break;
System.out.print("Price of this "+ item +" is: ");
price=sc.nextDouble();

