Hey i have a program thats due sunday and my teacher doesn't really teach that well....so i'm kinda confused and need help.
problem: read a file of positive intergers and then print each lin and then print each number in the line (i've done this part) this is where i get lost part to is to design and implement a new method that ask a user for a number and then searches the file for multiples of the user enter numbered....
this is what i have so far (it only does the first part of this program)
code!
//********************************************
//
//
//********************************************
import java.util.Scanner;
import java.io.*;
public class MultipleSelection
{
//Reads numbers from file and prints
public static void main (String[] args) throws IOException
{
String number;
Scanner fileScan, numberScan;
int value, limit, mul, count=0;
fileScan = new Scanner (new File("numbers.txt"));
//Read and process each line of the file
while(fileScan.hasNext())
{
number=fileScan.nextLine();
System.out.println(number);
numberScan = new Scanner (number);
numberScan.useDelimiter(",");
while(numberScan.hasNext())
System.out.println(" " + numberScan.next());
System.out.println();
}
}
}
text file!
56, 23, 46,25,
14, 15, 17, 19,
4, 5, 6, 4,
56, 9, 0, 65,
could someone help me or direct me to a similar program so i can get an understanding of what i am suppose to be doing! thanks