I'm trying to run this program and eventually display three names and three total amounts in the same window; each on a new line.
My first issue is that I can't enter the second and third name because once the loop starts it skips over the name input part.
Second issue: How do I get the window to show up last with all three names and totals?
public class Electric2
public static void main(String Args)
Scanner input = new Scanner(System.in);
while (totalCounter < 3)
System.out.println( "Enter customer name: ");
name = input.nextLine();
System.out.println( "Enter the amount of kilowatts used: " );
kilowatts = input.nextInt();
total = kilowatts * .056;
String message =
JOptionPane.showMessageDialog( null, message);
Thanks to anyone who helps or takes the time to read,