ok, here is the deal , i am given the following instuctions and through them i must write a program :

A bookstore has a system for managing its customers. The system keeps information about the books each customer has bought,his debit balance[ the customers have the option of buying with credit (in other words to pay after a few months)], and the total amount of money he has spent till now( the cost of the books he bought so far). For each customers ,are available the below data(integers):

his code ( which constructed by 3 capital letters and 5(number) digits) > (Code)

his age >(Age)

the number of Books he already bought > (Books)

Total amount he has paid(spent) so far> (Total)

Debit Balance > (Decifit)

(in parenthesis are the name of the variables)

The file 'bookstore.csv' contains 1000 records of clients, unclassified, which are 'printed' from source file 'printCSVFile.java'.

And Below are the "Questions"for this Project :

B1. to write a class named 'client', which contains the above elements.

B2. to write a method that calculates the average price of books purchased by the customer (to the nearest whole number). Sought retroactive implementation of the method.

B3. to write a method, which calculates the net profit per customer of the bookshop, ( the money already spent minus the debit balance.)

B4. to write a method, which calculates the amount of monthly installment, if the outstanding balance must be paid within 3 months for a balance of 100 € and within six months on balance over 100 € (without regard to any rate) .

B5. to write a method, which calculates the importance of a client. A customer is considered 'important':

a. if you are over 40 years, has purchased at least 30 books and the outstanding balance does not

exceed 5% of the amount already spent or

b. if between 25 and 40 years and has purchased at least 10 books on average at least 15 € or

c. if you are over 40 years and the amount already spent at least 1500 €.

B6. to write a method (out of the class) that outputs to the minimum, maximum, average and standard deviation of the number of books already purchased by customers, the amount already spent and their debt balance. Finally, print and the percentage of customers that is important.

B7. to write a method (out of the class) which can print all customers who have already spent more than a certain amount or customers who have already bought more than a specified number of books. The criterion of 'amount' or 'books' should be selected by the user, as well as the minimum for the selected criteria.

B8. to write a method (out of the Class) which is to seek a client based on his code, using the method of BinarySearch.

HERE is the link to bookstore.csv http://eduportal.dmst.aueb.gr/html/d...ore__13821.csv

and HERE is the printCSV.java http://eduportal.dmst.aueb.gr/html/d...le__13820.java

I thought that i need to first read the contents of csv , split the values wherever ther is a ";" an then insert them into an array. Thats for the first step. The problem is that i havent the slightest idea how to do so!( since the havent even mentioned this in class ...) I tried using scannner class but failed.

I experemented a litle and came up with this

but it returns a"input missmatch Exception" I believe that it is caused by the fact that the first coloumn is a read as a string( cause it has the form ex: AAA12345)int [][] customers = new int [1000][5]; File file = new File("bookstore.csv"); Scanner scanner = new Scanner(file); for (int i=0;i<1000;i++){ for (int j=0;j<5;j++){ pelates[i][j]= scanner.nextInt();} } System.out.println(customers[i][j]); //System.out.println(customers[999][1]);

Ive searched the net, and found about the StringTokenizer method, but i think that method reads all data as strings, meaning that customers array must be string type. if i do so though isnt it "imposible" to do the calculations mentioned afterwards?? ( ex: the minimun,max, average etc) .

Please i could really need some help on this, and if you could be kind enough to explain to me what to do .I dont want someone to solve it for me, just to help me . mostly with the arrays part