LOOping for my Customer ....
Ei guys help with my Code ... im stuck with it .. im begginer and i need some extra knowledge :-B
This code is sample only...
Code :
import java.io.*;
public class While1
{
public static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
public static void main(String args [])throws Exception
{
int customer = 0;
int num = 0;
String A = "";
int total = 0;
do{
System.out.print("enter a number: ");
num=Integer.parseInt(input.readLine());
System.out.print("Enter again:");
A = input.readLine();
total = num;
}while(A.equalsIgnoreCase("y"));
customer++;
if(A.equalsIgnoreCase("n"))
{
System.out.print("customer " + customer + ":");
if(A.equalsIgnoreCase("n"))
{
System.out.print(num);
System.out.print("\n ========\n"+"\n"+"\t"+total);
total+=num ;
}
System.out.println();
}
}
}
in this code .. i want to know how to add every customer .. Like if i enter 'Y' 5 times the customer will be print 5 times like
customer 1: , customer 2: etc , and then the total of every customer will be print and after that i will get the Sum of all the
customer ..
Sorry about that guys.. but please help:confused::confused:
Re: LOOping for my Customer ....
I might do not understand your question, here is my code:
hope this will be useful.
Re: LOOping for my Customer ....
lick999, please read the forum rules as well as the following: The Problems With Spoonfeeding
Re: LOOping for my Customer ....
I don't quite get what your trying to do, care to elaborate more?