hi i need some help with the following code. i want it to do the following:

if option 1 is selected from the switch(option), the program loops through the accounts again, asking for the current meter reading and calculating the bill for the next quarter. The previous meter reading is now the reading entered last time.

note: i have only put in the relevant code needed.

can anyone help please?

Code:

						int option = 0;
						while (option != 2)
						{
							System.out.println("\n*******************************");
							System.out.println("* 1. Generate quarterly bills *");
							System.out.println("* 2. Main Menu                *");
							System.out.println("*******************************\n");

							System.out.print("Please select an option: ");
							option=SimpleInput.readInt();

							switch(option)
							{
								case 1:
								{


									//account 1

									System.out.println("\nGenerating bill for customer " + myArray[2]);
									System.out.println("Last meter reading was " + myArray[3]);
									System.out.print("Current meter reading? ");
									myArray[20] = SimpleInput.readString();

									System.out.println("\nOctagon Utilites Gas Account for " + myArray[0]);
									System.out.println("Address: " + myArray[1]);
									System.out.println("Account number: " + myArray[2]);
									System.out.println("\tPrevious meter reading: " + myArray[3]);
									System.out.println("\tCurrent meter reading: " + myArray[20]);
									System.out.println("\t" + (Integer.parseInt(myArray[20]) - Integer.parseInt(myArray[3])) + " units used @ 1.5p per unit = " + (Integer.parseInt(myArray[20]) - Integer.parseInt(myArray[3]) * 0.015));
									System.out.println("\tStanding charge: 25.77");
									System.out.println("Total due: " + ((Integer.parseInt(myArray[20]) - Integer.parseInt(myArray[3]) * 0.015) + 25.77));

									//account 2

									System.out.println("\nGenerating bill for customer " + myArray[6]);
									System.out.println("Last meter reading was " + myArray[7]);
									System.out.print("Current meter reading? ");
									myArray[21] = SimpleInput.readString();

									System.out.println("\nOctagon Utilites Gas Account for " + myArray[4]);
									System.out.println("Address: " + myArray[5]);
									System.out.println("Account number: " + myArray[6]);
									System.out.println("\tPrevious meter reading: " + myArray[7]);
									System.out.println("\tCurrent meter reading: " + myArray[21]);
									System.out.println("\t" + (Integer.parseInt(myArray[21]) - Integer.parseInt(myArray[7])) + " units used @ 1.5p per unit = " + (Integer.parseInt(myArray[21]) - Integer.parseInt(myArray[7]) * 0.015));
									System.out.println("\tStanding charge: 25.77");
									System.out.println("Total due: " + ((Integer.parseInt(myArray[21]) - Integer.parseInt(myArray[7]) * 0.015) + 25.77));

									//account 3

									System.out.println("\nGenerating bill for customer " + myArray[10]);
									System.out.println("Last meter reading was " + myArray[11]);
									System.out.print("Current meter reading? ");
									myArray[22] = SimpleInput.readString();

									System.out.println("\nOctagon Utilites Gas Account for " + myArray[8]);
									System.out.println("Address: " + myArray[9]);
									System.out.println("Account number: " + myArray[10]);
									System.out.println("\tPrevious meter reading: " + myArray[11]);
									System.out.println("\tCurrent meter reading: " + myArray[22]);
									System.out.println("\t" + (Integer.parseInt(myArray[22]) - Integer.parseInt(myArray[11])) + " units used @ 1.5p per unit = " + (Integer.parseInt(myArray[22]) - Integer.parseInt(myArray[11]) * 0.015));
									System.out.println("\tStanding charge: 25.77");
									System.out.println("Total due: " + ((Integer.parseInt(myArray[22]) - Integer.parseInt(myArray[11]) * 0.015) + 25.77));

									//account 4

									System.out.println("\nGenerating bill for customer " + myArray[14]);
									System.out.println("Last meter reading was " + myArray[15]);
									System.out.print("Current meter reading? ");
									myArray[23] = SimpleInput.readString();

									System.out.println("\nOctagon Utilites Gas Account for " + myArray[12]);
									System.out.println("Address: " + myArray[13]);
									System.out.println("Account number: " + myArray[14]);
									System.out.println("\tPrevious meter reading: " + myArray[15]);
									System.out.println("\tCurrent meter reading: " + myArray[23]);
									System.out.println("\t" + (Integer.parseInt(myArray[23]) - Integer.parseInt(myArray[15])) + " units used @ 1.5p per unit = " + (Integer.parseInt(myArray[23]) - Integer.parseInt(myArray[15]) * 0.015));
									System.out.println("\tStanding charge: 25.77");
									System.out.println("Total due: " + ((Integer.parseInt(myArray[23]) - Integer.parseInt(myArray[15]) * 0.015) + 25.77));

									//account 5

									System.out.println("\nGenerating bill for customer " + myArray[18]);
									System.out.println("Last meter reading was " + myArray[19]);
									System.out.print("Current meter reading? ");
									myArray[24] = SimpleInput.readString();

									System.out.println("\nOctagon Utilites Gas Account for " + myArray[16]);
									System.out.println("Address: " + myArray[17]);
									System.out.println("Account number: " + myArray[18]);
									System.out.println("\tPrevious meter reading: " + myArray[19]);
									System.out.println("\tCurrent meter reading: " + myArray[24]);
									System.out.println("\t" + (Integer.parseInt(myArray[24]) - Integer.parseInt(myArray[19])) + " units used @ 1.5p per unit = " + (Integer.parseInt(myArray[24]) - Integer.parseInt(myArray[19]) * 0.015));
									System.out.println("\tStanding charge: 25.77");
									System.out.println("Total due: " + ((Integer.parseInt(myArray[24]) - Integer.parseInt(myArray[19]) * 0.015) + 25.77));

									//total

									System.out.println("\n*****  Summary information for this quarter  *****");

									System.out.println("\nCustomers billed: 5");
									System.out.println("Total units of gas used: " + ((Integer.parseInt(myArray[20]) - Integer.parseInt(myArray[3])) + (Integer.parseInt(myArray[21]) - Integer.parseInt(myArray[7])) + (Integer.parseInt(myArray[22]) - Integer.parseInt(myArray[11])) + (Integer.parseInt(myArray[23]) - Integer.parseInt(myArray[15])) + (Integer.parseInt(myArray[24]) - Integer.parseInt(myArray[19]))));
									System.out.println("Total amount billed: " + ((((Integer.parseInt(myArray[20]) - Integer.parseInt(myArray[3])) * 0.015) + 25.77) + (((Integer.parseInt(myArray[21]) - Integer.parseInt(myArray[7])) * 0.015) + 25.77) + (((Integer.parseInt(myArray[22]) - Integer.parseInt(myArray[11])) * 0.015) + 25.77) + (((Integer.parseInt(myArray[23]) - Integer.parseInt(myArray[15])) * 0.015) + 25.77) + (((Integer.parseInt(myArray[24]) - Integer.parseInt(myArray[19])) * 0.015) + 25.77)));

									
								}
								break;

								case 2:
								{
									System.out.println("\nExited to main menu");

								}
								break;

								default:
								{
									System.out.print("\nInvalid option! Please re-select.\n");
								}
								break;
							}
						}
				}
				break;

				case 2:
				{
					System.out.println("\nAccount Added!");

				}
				break;

				case 3:
				{
					System.out.println("\nAccount Deleted!");

				}
				break;

				case 4:
				{
					quit = 4;
					System.out.println("\nGoodbye!");

				}
				break;

				default:
				{
					System.out.print("\nInvalid option! Please re-select.\n");
				}
				break;
			}
		}
	}
}