-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
95 lines (77 loc) · 3.21 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
class Node{
String BookName,Author,Source,Genre;
float UserRating,Price;
int Reviews,PurchaseRatio,Sno;
Node(int Sno,String BookName,String Author,float UserRating,int Reviews,float Price,String Genre,String Source,int PurchaseRatio){
this.BookName = BookName;
this.Author=Author;
this.Source = Source;
this.Genre = Genre;
this.Price = Price;
this.UserRating= UserRating;
this.PurchaseRatio = PurchaseRatio;
this.Reviews = Reviews;
this.Sno=Sno;
}
public String getBookName() {
return BookName;
}
public String getAuthor() {
return Author;
}
public String getSource() {
return Source;
}
public String getGenre() {
return Genre;
}
public float getUserRating() {
return UserRating;
}
public int getPurchaseRatio() {
return PurchaseRatio;
}
public String toString()
{
return "\n[Sno]: " +this.Sno+" \n[Book Name]: "+this.BookName+ " \n[Author]: "+this.Author+ " \n[User Rating]: "+this.UserRating+ " \n[Reviews]: "+this.Reviews+ " \n[Price]: "+this.Price+ " \n[Genre]: "+this.Genre+ " \n[Source]: "+this.Source+ " \n[Purchase Rate]: "+this.PurchaseRatio + "\n----------------------------------------------------------------------------------------------------------------\n";
}
}
class re{
Node Book;
double score;
re(Node Book, double score){
this.Book=Book;
this.score=score;
}
@Override
public String toString() {
return "score=" + score +
"\nBook details:\n" + Book;
}
}
public class Main {
public static void main(String[] args) throws FileNotFoundException {
general obj = new general();
Option option=new Option();
Scanner sc = new Scanner(System.in);
String[] A = obj.filing("amazon.csv");
String sp0[][] = obj.extract(A);
String[] B = obj.filing("UrduBazar.csv");
String sp1[][] = obj.extract(B);
String[] C = obj.filing("ZStore.csv");
String sp2[][] = obj.extract(C);
String sp[][] = obj.Fi(sp0, sp1, sp2);
HashSet<Node> o = new HashSet<>();
for (int j = 0; j < 49; j++) {
o.add(new Node(Integer.parseInt(sp[j][0]), sp[j][1], sp[j][2], Float.parseFloat(sp[j][3]), Integer.parseInt(sp[j][4]), Float.parseFloat(sp[j][5]), sp[j][6], sp[j][7], Integer.parseInt(sp[j][8])));
}
int numberofBooks = 0, choice = 0;
HashSet<Node> book = null;
option.setO(o);
System.out.println("---------------------------------------------------------------------------------\n|\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t Welcome To BookKeeper\n|\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n---------------------------------------------------------------------------------");
option.opt(o);
}
}