forked from lim-at-infinity/CIS18C-Final-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTester_2.java
60 lines (49 loc) · 2.11 KB
/
Tester_2.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
package tester_2;
/**
*
* @author pita
*/
public class Tester_2
{
public static void main(String[] args)
{
Books books = new Books();
System.out.println(books.addBook(1, "The Alchemist", "189-hn3-038n", "Paulo Cohelo"));
System.out.println(books.addBook(2, "Mary Had a Little Lamb", "37h-193a-9jj", "Mozart"));
System.out.println(books.addBook(3, "Calculus 1", "777-777-7777", "Newton"));
System.out.println(books.displayBooks());
// Test the Queue system with the Alchemist.
System.out.println("Juan checks out 'The Alchemist'.");
System.out.println(books.checkoutBook("The Alchemist", "Juan"));
System.out.println(books.displayBooks());
System.out.println("Pablo checks out 'The Alchemist'.");
System.out.println(books.checkoutBook("The Alchemist", "Pablo"));
System.out.println(books.displayBooks());
System.out.println("Manda checks out 'The Alchemist'.");
System.out.println(books.checkoutBook("The Alchemist", "Manda"));
System.out.println(books.displayBooks());
System.out.println("Juan returns 'The Alchemist'.");
System.out.println(books.returnBook("The Alchemist"));
System.out.println(books.displayBooks());
System.out.println("Pita checks out 'The Alchemist'.");
System.out.println(books.checkoutBook("The Alchemist", "Pita"));
System.out.println(books.displayBooks());
// Test the class User wich implements quicksort and binary search
Users users = new Users();
System.out.println(users.addUser("Pita", 852));
System.out.println(users.addUser("Beto", 658));
System.out.println(users.addUser("Juan", 966));
System.out.println(users.addUser("Manda", 10));
System.out.println(users.addUser("Pablo", 527));
System.out.println();
System.out.println("Displaying Users.");
System.out.println(users.displayUsers());
System.out.println("Displaying users after sorting.");
users.sortUsers();
System.out.println(users.displayUsers());
System.out.println("Searching for user with id: 527");
System.out.println("User is : " + users.searchById(527));
System.out.println("Searching for user with id: 3000");
System.out.println("User is : " + users.searchById(3000));
}
}