Posted: Tue Jan 11, 2005 9:53 pm Post subject: Java project help (java sorting)
code:
import java.io.*;
class menuh
{
public static void main (String[] args) throws IOException
{
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
int x = 0;
String line;
int limit = 0;
BufferedReader stdin = new BufferedReader (
new InputStreamReader (System.in));
mainLoop:
while (true)
{
System.out.println ("");
System.out.println ("1. Input Information");
System.out.println ("2. Change Information");
System.out.println ("3. Organize Information");
System.out.println ("4. Exit");
char choices = in.readLine ().charAt (0);
switch (choices)
{
case '1':
System.out.println ("Input Information");
System.out.println ("----------------------");
System.out.println ("Please choose a format to input information");
System.out.println ("1. Enter data from CVS file");
System.out.println ("2. Enter data manually");
char option = in.readLine ().charAt (0);
switch (option)
{
case '1':
line = stdin.readLine ();
limit = Integer.parseInt (line.trim ());
String names[] = new String [limit];
String sex[] = new String [limit];
int number[] = new int [limit];
int Cnumber[] = new int [limit];
String email[] = new String [limit];
String address[] = new String [limit];
System.out.println ("You have chosen to enter from a CVS file");
public static void read () throws IOException //reading from a file
{
String fileName = "C:/text.txt";
BufferedReader fileIn = new BufferedReader (new FileReader (text.txt));
for (int i = 0 ; i < limit ; i++)
{
string = fileIn.readLine ();
}
}
break;
default:
System.out.println ("Incorrect choice, please choose again " + choices);
break;
case '2':
System.out.println ("You have chosen to enter manually");
System.out.println ("Please enter the number of people in your address book");
When i run it i get 18 errors, what is the problem? how do i fix it?
Sponsor Sponsor
Tony
Posted: Tue Jan 11, 2005 10:07 pm Post subject: (No subject)
you get a compiler that returns error messages, with a description of a problem and the line number. Then you read those messages and fix your semi-colons or whatever.