ok, i need help adding to a list after the list have been made. Its the only thing stopping me from getting this thing done, help please....
import java.util.Scanner;
import java.io.*;
import java.util.*;
public class Dairy{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
String [][] job = new String [200][7];
int choice = 1;
System.out.print("Please enter the amount of friends you want to enter in the start: \n");
String Friends = keyboard.next();
int friends = Integer.parseInt(Friends);
System.out.println();
while(choice != 0){
System.out.println("Please choose an option: "
+"\n1. Create your friend list with information."
+"\n2. Edit an entry."
+"\n3. Add a friend to the list."
+"\n4. Sort your information."
+"\n5. Print the information to the console."
+"\n6. Send your friend information to .txt or .doc file."
+"\n0. To Exit the Program.");
System.out.print("\nPlease make your choice by number: ");
/* Reads in Choice for menu */
String Choice = keyboard.next();
choice = Integer.parseInt(Choice);
switch(choice){
case 1://Enter in People
for(int x = 0; x < friends; x++){
System.out.println("Information for friend " + (x + 1) + ": \n");
System.out.print("Enter in the friend's First Name: ");
job[x][0] = keyboard.next();
System.out.print("Enter in the friend's Lazt Name: ");
job[x][1] = keyboard.next();
System.out.print("Enter in the friend's email: ");
job[x][2] = keyboard.next();
System.out.print("Enter in the friend's School(No Spaces): ");
job[x][3] = keyboard.next();
System.out.print("Enter in the friend's classification: ");
job[x][4] = keyboard.next();
System.out.print("Enter in the friend's major(No Spaces): ");
job[x][5] = keyboard.next();
System.out.print("Enter in the friend's number of pictures: ");
job[x][6] = keyboard.next();
System.out.println();
System.out.println();
}
break;
case 2://Edit Entries
System.out.println("What would you like to Edit?"
+"\n1. Frist Name."
+"\n2. Last Name."
+"\n3. Email Address."
+"\n4. School."
+"\n5. Classification."
+"\n6. Major."
+"\n7. Number of Pictures.");
System.out.print("Please enter in your choice: ");
String Edit = keyboard.next();
int edit = Integer.parseInt(Edit);
System.out.println();
System.out.print("Please enter in the Last Name of the friend you want to edit: ");
String Last = keyboard.next();
for(int m = 0; m < friends; m++){
if(job[m][1].compareToIgnoreCase( Last ) == 0){
System.out.print("Enter in the new information for " + Last + ": ");
job[m][(edit - 1)] = keyboard.next();
break;
}
}
break;
case 3://Add entries
break;
case 4://Sort
break;
case 5://Print
System.out.println("First Name\tLast Name\tEmail\tSchool\tClass\tMajor\tNumber of Pics");
for(int n = 0; n < friends; n++){
for(int o = 0; o < 7; o++){
System.out.print(job[n][o] + "\t");
}
System.out.println();
}
break;
case 6://Send to File
break;
}
}
}
}