|
while loop
hi, i am having a bit of a problem. i'm a newb when it comes to programming, especially java. i need to know how to start this problem.
public class printContact {
public static final int MAX_ENTRIES = 10;
public static int curr_entries = 6;
public static String[] first_names = {"Stan","Fredia","James","Sandra","Jerry","Robin"} ;
public static String[] last_names = {"Marko","Zells","Johnson","Christmas","kelly","By rde"};
public static String[] street_address = {"2 Easy Street","23 King Junction","10207 W. OuttaMy Way","18 Walker Blvd","00 Memory Lane","16 Lovers Lane"};
public static String[] city = {"Ann Arbor","Ypsilanit","Belleville","Dexter","Maumee", "Toledo"};
public static String[] state = {"Michigan","Michigan","Michigan","Michigan","Ohio ","Ohio"};
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
1. On the first line, separated by space, print first name and last name.
2. On the second line the street address.
3. On the third line, separated by a comma and a space, write out the city and state.
Since the information is stored in parallel arrays use a while loop to print out the information. Use integer variables to index the arrays and also use integer(s), boolean(s) and/or constants to terminate the while loop. Do not use hard coded numeric values in the code except to initialize constants or variables.
thank you.
|