├── .gitignore ├── LICENSE ├── PT1-Hotel ├── Batın Eryılmaz (✔) │ ├── Customer.java │ ├── Hostel.java │ ├── HostelTest.java │ └── Room.java ├── Beyza Kaynar │ ├── Customer.java │ └── Room.java ├── Hasan Tezcan │ ├── Customer.java │ ├── Hotel.java │ ├── HotelTest.java │ └── Room.java ├── README.md ├── alperenisik (✔) │ ├── Book.java │ ├── Customer.java │ ├── Deluxe.java │ ├── HotelRoomService.java │ ├── Laundry.java │ ├── Luxury.java │ ├── Pay.java │ ├── README.md │ ├── SuperDeluxe.java │ └── Welcome.java └── boratanrikulu (✔) │ ├── Customer.java │ ├── Hotel.java │ ├── Menu.java │ ├── README.md │ └── Room.java ├── PT2-Bookstore ├── Batın Eryılmaz (✔) │ ├── Book.java │ ├── BookStore.java │ ├── BookStoreTest.java │ ├── Employee.java │ ├── FantasticSection.java │ ├── LiteratureSection.java │ ├── PhilosophySection.java │ ├── README.md │ ├── SciFiSection.java │ ├── Section.java │ ├── Staff.java │ └── SuperVisor.java ├── README.md └── boratanrikulu (✔) │ ├── Employees │ ├── Staff.java │ └── SuperVisor.java │ ├── Mains │ ├── Book.java │ ├── BookStore.java │ ├── Employee.java │ ├── Menu.java │ └── Section.java │ ├── README.md │ ├── Sections │ ├── History.java │ ├── Mythology.java │ ├── Poem.java │ └── SciFi.java │ ├── preview.png │ └── preview2.png ├── PT3-LoginPage ├── Batın Eryılmaz (✔) │ ├── Login.form │ ├── Login.java │ ├── LoginResult.form │ ├── LoginResult.java │ ├── OpeningPage.form │ ├── OpeningPage.java │ ├── Project_3.jar │ ├── Register.form │ └── Register.java ├── README.md └── boratanrikulu (✔) │ ├── MainWindow.java │ ├── README.md │ ├── RegisterLogin.java │ └── preview.png ├── PT4-Cinema ├── README.md ├── boratanrikulu (✔) │ ├── Cinema │ │ ├── build.xml │ │ ├── build │ │ │ ├── built-jar.properties │ │ │ └── classes │ │ │ │ └── cinema │ │ │ │ ├── logo.png │ │ │ │ ├── screen.png │ │ │ │ ├── selected-seat.png │ │ │ │ ├── taken-seat.png │ │ │ │ └── vacant-seat.png │ │ ├── dist │ │ │ ├── Cinema.jar │ │ │ ├── README.TXT │ │ │ └── lib │ │ │ │ ├── jsoup-1.11.3.jar │ │ │ │ └── mariadb-java-client-2.2.5.jar │ │ ├── manifest.mf │ │ ├── nbproject │ │ │ ├── build-impl.xml │ │ │ ├── genfiles.properties │ │ │ ├── private │ │ │ │ ├── private.properties │ │ │ │ └── private.xml │ │ │ ├── project.properties │ │ │ └── project.xml │ │ └── src │ │ │ └── cinema │ │ │ ├── DatabaseProcesses │ │ │ ├── DatabaseConnector.java │ │ │ ├── DatabaseInfo.java │ │ │ └── Scrape │ │ │ │ ├── IMDb_Scraper.java │ │ │ │ └── UpdateDB.java │ │ │ ├── Frames │ │ │ ├── BuyTickets.form │ │ │ ├── BuyTickets.java │ │ │ ├── ShowMovies.form │ │ │ ├── ShowMovies.java │ │ │ ├── ShowSeats.form │ │ │ ├── ShowSeats.java │ │ │ ├── SignIn.form │ │ │ ├── SignIn.java │ │ │ ├── SignUp.form │ │ │ └── SignUp.java │ │ │ ├── Objects │ │ │ ├── Customer.java │ │ │ ├── Movie.java │ │ │ ├── Seat.java │ │ │ └── Theatre.java │ │ │ ├── logo.png │ │ │ ├── screen.png │ │ │ ├── selected-seat.png │ │ │ ├── taken-seat.png │ │ │ └── vacant-seat.png │ ├── JAR │ │ ├── Cinema.jar │ │ └── lib │ │ │ ├── jsoup-1.11.3.jar │ │ │ └── mariadb-java-client-2.2.5.jar │ ├── README.md │ ├── cinema.sql │ └── img │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ └── 4.png └── img │ └── javaUtilHelp.png └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 java-util-help 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /PT1-Hotel/Batın Eryılmaz (✔)/Customer.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 4 | * @author BATIN 5 | */ 6 | public class Customer { 7 | 8 | private String Name = ""; 9 | private String Surname = ""; 10 | private String Occupation = ""; 11 | private int Age = 0; 12 | 13 | public enum Sex { 14 | Female, 15 | Male 16 | }; 17 | Sex sex; 18 | 19 | public Customer() { 20 | 21 | } 22 | 23 | public Customer(String Name, String Surname, String Occupation, int Age, Sex sex) { 24 | this.Name = Name; 25 | this.Surname = Surname; 26 | this.Occupation = Occupation; 27 | this.Age = Age; 28 | this.sex = sex; 29 | } 30 | 31 | public String getName() { 32 | return Name; 33 | } 34 | 35 | public void setName(String Name) { 36 | this.Name = Name; 37 | } 38 | 39 | public String getSurname() { 40 | return Surname; 41 | } 42 | 43 | public void setSurname(String Surname) { 44 | this.Surname = Surname; 45 | } 46 | 47 | public String getOccupation() { 48 | return Occupation; 49 | } 50 | 51 | public void setOccupation(String Occupation) { 52 | this.Occupation = Occupation; 53 | } 54 | 55 | public int getAge() { 56 | return Age; 57 | } 58 | 59 | public void setAge(int Age) { 60 | this.Age = Age; 61 | } 62 | 63 | public Sex getSex() { 64 | return sex; 65 | } 66 | 67 | public void setSex(Sex sex) { 68 | this.sex = sex; 69 | } 70 | 71 | public void Display() { 72 | if (this.Age != 0) { 73 | System.out.println("Name: " + Name + " Surname: " + Surname + " Occupation: " + Occupation + " Age: " + Age + " Sex: " + sex); 74 | 75 | 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /PT1-Hotel/Batın Eryılmaz (✔)/Hostel.java: -------------------------------------------------------------------------------- 1 | 2 | import java.util.ArrayList; 3 | import java.util.InputMismatchException; 4 | import java.util.Scanner; 5 | 6 | /** 7 | * 8 | * @author BATIN 9 | */ 10 | public class Hostel { 11 | 12 | Scanner sc = new Scanner(System.in); 13 | private final String HostelName; 14 | private final int TotalRoomCount; 15 | private final int FullService = 100; 16 | private final int HalfService = 80; 17 | private final int OnlyRoom = 60; 18 | private final int FrencToast = 10; 19 | private final int Burger = 12; 20 | private final int Water = 3; 21 | private final int percent; 22 | Room[] rooms; 23 | private int Bill = 0; 24 | private int r1 = 0; 25 | private int r2 = 0; 26 | private int r3 = 0; 27 | private int r4 = 0; 28 | private int r5 = 0; 29 | 30 | public Hostel(String HostelName, int TotalRoomCount) { 31 | this.HostelName = HostelName; 32 | this.TotalRoomCount = TotalRoomCount; 33 | percent = TotalRoomCount / 10; 34 | rooms = new Room[TotalRoomCount]; 35 | for (int i = 0; i < TotalRoomCount; i++) { 36 | if (percent * 2 > i) { 37 | rooms[i] = new Room("10" + i, 0, 2, Room.Types.BedRoomFor2); 38 | r1++; 39 | } 40 | if (percent * 2 <= i && percent * 4 > i) { 41 | rooms[i] = new Room("10" + i, 0, 3, Room.Types.BedRoomFor3); 42 | r2++; 43 | } 44 | if (percent * 4 <= i && percent * 6 > i) { 45 | rooms[i] = new Room("10" + i, 0, 4, Room.Types.BedRoomFor4); 46 | r3++; 47 | } 48 | if (percent * 6 <= i && percent * 7 > i) { 49 | rooms[i] = new Room("10" + i, 100, 5, Room.Types.KingSuite); 50 | r4++; 51 | } 52 | if (percent * 7 <= i && TotalRoomCount > i) { 53 | rooms[i] = new Room("10" + i, -25, 6, Room.Types.EconomicRoom); 54 | r5++; 55 | } 56 | 57 | } 58 | } 59 | 60 | public void CutomerEnterence() { 61 | //Room TheRoom=new Room(OnlyRoom, Room.Types.KingSuite); 62 | System.out.println("Which type of room you would like to stay"); 63 | System.out.println("1 to Regular Bed Room For 2"); 64 | System.out.println("2 to Regular Bed Room For 3"); 65 | System.out.println("3 to Regular Bed Room For 4"); 66 | System.out.println("4 to Economic Bed Room For 6"); 67 | System.out.println("5 to King Suite For 5"); 68 | int S = GetInteger(5); 69 | 70 | switch (S) { 71 | case 1: 72 | AddPerson(2, rooms[r1]); 73 | r1--; 74 | break; 75 | case 2: 76 | AddPerson(3, rooms[r2]); 77 | r2--; 78 | break; 79 | case 3: 80 | AddPerson(4, rooms[r3]); 81 | r3--; 82 | break; 83 | case 4: 84 | AddPerson(6, rooms[r4]); 85 | r4--; 86 | break; 87 | case 5: 88 | AddPerson(5, rooms[r5]); 89 | r5--; 90 | break; 91 | default: 92 | System.out.println("Wrong! Choice Must Be Between 1-5"); 93 | } 94 | } 95 | 96 | private void AddPerson(int num, Room r) { 97 | 98 | int RoomMateCount = 0; 99 | ArrayList list = new ArrayList(); 100 | Customer c1; 101 | 102 | char Choice = 'Y'; 103 | while (Choice == 'Y') { 104 | System.out.println((RoomMateCount + 1) + ".Person"); 105 | 106 | System.out.print("Name: "); 107 | String Name = GetString(); 108 | 109 | System.out.print("Surname: "); 110 | String Surname = GetString(); 111 | 112 | System.out.print("Occupation: "); 113 | String Occupation = GetString(); 114 | 115 | System.out.print("Age: "); 116 | int Age = GetInteger(100); 117 | 118 | System.out.println("1 -> Male \n2 -> Female"); 119 | int Sex = GetInteger(2); 120 | while (true) { 121 | if (Sex == 1) { 122 | c1 = new Customer(Name, Surname, Occupation, Age, Customer.Sex.Male); 123 | break; 124 | } else if (Sex == 2) { 125 | c1 = new Customer(Name, Surname, Occupation, Age, Customer.Sex.Female); 126 | break; 127 | } 128 | } 129 | System.out.println("Which Service Do You Want? "); 130 | System.out.println(" 1 -> Full Service: 100$ \n 2 -> Half Service:80$ \n 3 -> Just Room:60$ "); 131 | int Service = GetInteger(3); 132 | while (true) { 133 | if (Service == 1) { 134 | if (c1.getAge() > 12) { 135 | Bill += FullService; 136 | } else { 137 | Bill += FullService / 2; 138 | } 139 | break; 140 | } else if (Service == 2) { 141 | if (c1.getAge() > 12) { 142 | Bill += HalfService; 143 | } else { 144 | Bill += HalfService / 2; 145 | } 146 | break; 147 | } else if (Service == 3) { 148 | if (c1.getAge() > 12) { 149 | Bill += OnlyRoom; 150 | } else { 151 | Bill += OnlyRoom / 2; 152 | } 153 | break; 154 | } else { 155 | System.out.println("Wrong! Choice Must Between 1-3"); 156 | } 157 | } 158 | r.setBill(Bill); 159 | list.add(c1); 160 | RoomMateCount++; 161 | System.out.println("Would you like to add more person?(Y/N)"); 162 | String temp=sc.next().toUpperCase(); 163 | Choice = temp.charAt(0); 164 | 165 | if (RoomMateCount == num) { 166 | Choice = 'N'; 167 | } 168 | } 169 | Customer[] roomMates = list.toArray(new Customer[list.size()]); 170 | 171 | r.setCustomers(roomMates); 172 | r.setS(Room.Status.NotAvalible); 173 | } 174 | 175 | public void CustomerLeaves() { 176 | ArrayList list = new ArrayList(); 177 | System.out.print("Please Enter Your Room Number:"); 178 | String num = GetString(); 179 | Customer c2 = new Customer(); 180 | for (Room room : rooms) { 181 | for (int i = 0; i < room.getCustomerCount(); i++) { 182 | list.add(c2); 183 | } 184 | Customer[] roomMates = list.toArray(new Customer[list.size()]); 185 | if (room.getRoomNumber().equals(num)) { 186 | room.setS(Room.Status.Avalible); 187 | if (null != room.getType()) { 188 | switch (room.getType()) { 189 | case BedRoomFor2: 190 | room.setBill(0); 191 | room.setCustomers(roomMates); 192 | break; 193 | case BedRoomFor3: 194 | room.setCustomers(roomMates); 195 | room.setBill(0); 196 | break; 197 | case BedRoomFor4: 198 | room.setCustomers(roomMates); 199 | room.setBill(0); 200 | break; 201 | case EconomicRoom: 202 | room.setCustomers(roomMates); 203 | room.setBill(-50); 204 | break; 205 | case KingSuite: 206 | room.setCustomers(roomMates); 207 | room.setBill(100); 208 | break; 209 | default: 210 | break; 211 | } 212 | } 213 | 214 | } 215 | } 216 | 217 | } 218 | 219 | public void DisplayRooms() { 220 | 221 | for (Room room : rooms) { 222 | room.Display(); 223 | } 224 | 225 | } 226 | 227 | public void DisplayCustomers() { 228 | for (Room room : rooms) { 229 | room.DisplayCutomers(); 230 | } 231 | 232 | } 233 | 234 | public void Order() { 235 | System.out.print("Please Enter Room Number: "); 236 | String num = GetString(); 237 | int Choice; 238 | for (Room room : rooms) { 239 | if (num.equals(room.getRoomNumber())) { 240 | 241 | boolean flag = true; 242 | while (flag) { 243 | 244 | System.out.println("1 to French Toast: 10$"); 245 | System.out.println("2 to Burger: 12$"); 246 | System.out.println("3 to Water: 3$"); 247 | System.out.println("4 to Exit"); 248 | Choice = GetInteger(4); 249 | switch (Choice) { 250 | case 1: 251 | System.out.println("You ordered Frech Toast"); 252 | Bill += FrencToast; 253 | break; 254 | case 2: 255 | System.out.println("You ordered Burger"); 256 | Bill += Burger; 257 | break; 258 | case 3: 259 | System.out.println("You ordered Water"); 260 | Bill += Water; 261 | break; 262 | case 4: 263 | room.setBill(Bill); 264 | flag = false; 265 | break; 266 | default: 267 | System.out.println("Wrong! Choice Must Be Between 1-4"); 268 | } 269 | 270 | } 271 | } 272 | } 273 | 274 | } 275 | 276 | /*------------ONLY GETTER I NEED--------------*/ 277 | public String getHostelName() { 278 | return HostelName; 279 | } 280 | 281 | /*-------------------------------------------*/ 282 | 283 | /*---------------INPUT LOOP WITH TRY CATCH--------------*/ 284 | public int GetInteger(int Num) { 285 | int input = 0; 286 | do { 287 | try { 288 | input = sc.nextInt(); 289 | } catch (InputMismatchException e) { 290 | System.out.println("Please give a number between 1 and " + Num); 291 | sc.next(); 292 | } 293 | } while (input == 0); 294 | return input; 295 | } 296 | 297 | public String GetString() { 298 | String s = ""; 299 | boolean t = true; 300 | while (t) { 301 | try { 302 | s = sc.next(); 303 | t = false; 304 | } catch (InputMismatchException e) { 305 | System.out.println("Wrong!"); 306 | t = true; 307 | } 308 | } 309 | return s; 310 | } 311 | /*-------------------------------------------*/ 312 | } 313 | -------------------------------------------------------------------------------- /PT1-Hotel/Batın Eryılmaz (✔)/HostelTest.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.util.Scanner; 4 | 5 | /** 6 | * 7 | * @author BATIN 8 | */ 9 | public class HostelTest { 10 | 11 | /** 12 | * @param args the command line arguments 13 | */ 14 | public static void main(String[] args) { 15 | Scanner sc = new Scanner(System.in); 16 | Hostel h1 = new Hostel("Bato", 10); 17 | System.out.println("Welcome To Hostel " + h1.getHostelName()); 18 | boolean flag = true; 19 | 20 | while (flag) { 21 | System.out.println("1 to Rent A Room"); 22 | System.out.println("2 to List of Customers"); 23 | System.out.println("3 to See The Rooms"); 24 | System.out.println("4 to Order Something To Your Room"); 25 | System.out.println("5 to Leave From Hostel"); 26 | System.out.println("6 to Exit"); 27 | int Choice = h1.GetInteger(5); 28 | switch (Choice) { 29 | case 1: 30 | h1.CutomerEnterence(); 31 | break; 32 | case 2: 33 | h1.DisplayCustomers(); 34 | break; 35 | case 3: 36 | h1.DisplayRooms(); 37 | break; 38 | case 4: 39 | h1.Order(); 40 | break; 41 | case 5: 42 | h1.CustomerLeaves(); 43 | break; 44 | case 6: 45 | flag = false; 46 | break; 47 | default: 48 | System.out.println("Wrong! Choice Must Be Between 1-5"); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PT1-Hotel/Batın Eryılmaz (✔)/Room.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 4 | * @author BATIN 5 | */ 6 | public class Room { 7 | 8 | private String RoomNumber; 9 | private double Bill; 10 | private final int CustomerCount; 11 | 12 | 13 | 14 | public enum Status { 15 | Avalible, 16 | NotAvalible 17 | } 18 | Status S; 19 | 20 | public enum Types { 21 | KingSuite, 22 | BedRoomFor2, 23 | BedRoomFor3, 24 | BedRoomFor4, 25 | EconomicRoom 26 | 27 | }; 28 | Types type; 29 | Customer[] customers; 30 | 31 | public Room(String RoomNumber, double Bill, int CustomerCount, Types type) { 32 | this.RoomNumber = RoomNumber; 33 | this.Bill = Bill; 34 | this.CustomerCount = CustomerCount; 35 | this.type = type; 36 | customers = new Customer[CustomerCount]; 37 | for (int i = 0; i < CustomerCount; i++) { 38 | customers[i] = new Customer(); 39 | } 40 | this.S = Status.Avalible; 41 | } 42 | 43 | public int getCustomerCount() { 44 | return CustomerCount; 45 | } 46 | 47 | public Status getS() { 48 | return S; 49 | } 50 | 51 | public void setS(Status S) { 52 | this.S = S; 53 | } 54 | 55 | public Customer[] getCustomers() { 56 | return customers; 57 | } 58 | 59 | public void setCustomers(Customer[] customers) { 60 | this.customers = customers; 61 | } 62 | 63 | public String getRoomNumber() { 64 | return RoomNumber; 65 | } 66 | 67 | public void setRoomNumber(String RoomNumber) { 68 | this.RoomNumber = RoomNumber; 69 | } 70 | 71 | public double getBill() { 72 | return Bill; 73 | } 74 | 75 | public void setBill(double Bill) { 76 | this.Bill = Bill; 77 | } 78 | 79 | public Types getType() { 80 | return type; 81 | } 82 | 83 | public void setType(Types type) { 84 | this.type = type; 85 | } 86 | 87 | public void Display() { 88 | System.out.println("Room " + RoomNumber + " Room Type: " + type + " Status: " + S + " Bill: " + Bill); 89 | 90 | } 91 | 92 | public void DisplayCutomers() { 93 | for (Customer c1 : customers) { 94 | c1.Display(); 95 | 96 | } 97 | 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /PT1-Hotel/Beyza Kaynar/Customer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package project.pkg1; 7 | 8 | /** 9 | * 10 | * @author MEDİA MARKT 11 | */ 12 | public class Customer { 13 | 14 | private String name; 15 | private String surname; 16 | private int age; 17 | private String job; 18 | 19 | public Customer (String name,String surname,int age, String job){ 20 | 21 | this.name = name; 22 | this.surname = surname; 23 | this.age = age; 24 | this.job = job; 25 | } 26 | 27 | public String getName(){ 28 | return name; 29 | } 30 | 31 | public void setName(String name){ 32 | this.name = name; 33 | } 34 | 35 | public String getSurname(){ 36 | return name; 37 | } 38 | 39 | public void setSurname(String surname){ 40 | this.surname = surname; 41 | } 42 | 43 | public int getAge(){ 44 | return age; 45 | } 46 | 47 | public void setAge(int age){ 48 | this.age = age; 49 | } 50 | 51 | public String getJob(){ 52 | return job; 53 | } 54 | 55 | public void setJob(String job){ 56 | this.job = job; 57 | } 58 | 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /PT1-Hotel/Beyza Kaynar/Room.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package project.pkg1; 7 | 8 | /** 9 | * 10 | * @author MEDİA MARKT 11 | */ 12 | public class Room { 13 | 14 | private int number; 15 | private String type; 16 | private int price; 17 | 18 | 19 | private enum status{ 20 | BOS, 21 | DOLU 22 | }; 23 | status x; 24 | 25 | public Room(int number) { 26 | this.number = number; 27 | x = status.BOS; 28 | } 29 | 30 | 31 | public status getX() { 32 | return x; 33 | } 34 | 35 | public void setX() { 36 | x = status.DOLU; 37 | } 38 | 39 | public int getNumber() { 40 | return number; 41 | } 42 | 43 | public void setNumber(int number) { 44 | this.number = number; 45 | } 46 | 47 | 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /PT1-Hotel/Hasan Tezcan/Customer.java: -------------------------------------------------------------------------------- 1 | package hotel; 2 | 3 | public class Customer { 4 | 5 | private String name; 6 | private String surname; 7 | private String profession; 8 | private int age; 9 | private String ID; 10 | private Room Room; 11 | private int howManyNight; 12 | private int bill = 0; // müşterinin hesabı ..... tüm ücretlendirmeler bunun üstününe olucak 13 | 14 | public enum Tariff { // pansiyonları burda aldırıdım seçime göre ana paraya ne kadar eklencek o belirleniyor. 15 | justRoom("justRoom", 0), 16 | halfTariff("halfTarif", 20), 17 | fullTariff("fullTarif", 40), 18 | includeEverything("includeEverything", 100); 19 | 20 | String tariffType; 21 | int credit; 22 | 23 | Tariff(String tariffType, int credit) { 24 | this.tariffType = tariffType; 25 | this.credit = credit; 26 | } 27 | } 28 | 29 | private Tariff tariff; 30 | 31 | Customer(String name, String surname, String profession, int age, String ID, Room Room, int HowManyNight,Tariff tariff) { 32 | this.name = name; 33 | this.surname = surname; 34 | this.profession = profession; 35 | this.age = age; 36 | this.ID = ID; 37 | 38 | 39 | this.Room = Room; // hotel classında bunu aldıramadım... 40 | // this.ta // tariff i buraya nasıl dahil edicem 41 | 42 | this.tariff = tariff; 43 | 44 | } 45 | 46 | public int gethowManyNight() { 47 | return howManyNight; 48 | } 49 | 50 | public void sethowManyNight(int howManyNight) { 51 | this.howManyNight = howManyNight; 52 | } 53 | 54 | public Room getRoom() { 55 | return Room; 56 | } 57 | 58 | public void setRoom(Room room) { 59 | this.Room = room; 60 | } 61 | 62 | public String getID() { 63 | return ID; 64 | } 65 | 66 | public void setID(String ID) { 67 | this.ID = ID; 68 | } 69 | 70 | public int getAge() { 71 | return age; 72 | } 73 | 74 | public void setAge(int age) { 75 | this.age = age; 76 | } 77 | 78 | public String getName() { 79 | return name; 80 | } 81 | 82 | public void setName(String name) { 83 | this.name = name; 84 | } 85 | 86 | public String getSurname() { 87 | return surname; 88 | } 89 | 90 | public void setSurname(String surname) { 91 | this.surname = surname; 92 | } 93 | 94 | public String getProfession() { 95 | return profession; 96 | } 97 | 98 | public void setProfession(String profession) { 99 | this.profession = profession; 100 | } 101 | 102 | public void Display() { 103 | System.out.println("Name= " + name); 104 | System.out.println("Surname= " + surname); 105 | System.out.println("Age= " + age); 106 | System.out.println("Profession= " + profession); 107 | System.out.println("ID= " + ID); 108 | System.out.println("How many night will they stay=" + howManyNight); 109 | 110 | //String kelek = Room.Display(); 111 | System.out.println("Room Info= "); Room.Display(); // void tüüründeki bi şeyi sout içine çağıramassın ve herhangi bir değişkene eşitleyemezsin. 112 | 113 | System.out.println("Bill == " + bill); 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /PT1-Hotel/Hasan Tezcan/Hotel.java: -------------------------------------------------------------------------------- 1 | package hotel; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Hotel { 6 | 7 | private String Name; 8 | private int roomNumber; 9 | private int hotelStar; 10 | Room[] roomsAray; 11 | //These are keep the people count.. 12 | int eco2=0; 13 | 14 | int eco4=0; 15 | int nrml2=0; 16 | 17 | int nrml4=0; 18 | int kingS=0; 19 | 20 | 21 | public Hotel(String Name, int roomNumber, int hotelStar){ 22 | this.Name = Name; 23 | this.roomNumber = 20; 24 | this.hotelStar = hotelStar; 25 | createRoom(); 26 | 27 | 28 | } 29 | 30 | 31 | public Hotel(){ 32 | 33 | } 34 | 35 | public int getHotelStar() { 36 | return hotelStar; 37 | } 38 | 39 | public void setHotelStar(int hotelStar) { 40 | this.hotelStar = hotelStar; 41 | } 42 | 43 | public String getName() { 44 | return Name; 45 | } 46 | 47 | public void setName(String Name) { 48 | this.Name = Name; 49 | } 50 | 51 | public int getRoomNumber() { 52 | return roomNumber; 53 | } 54 | 55 | public void setRoomNumber(int roomNumber) { 56 | this.roomNumber = roomNumber; 57 | } 58 | 59 | 60 | public void createRoom(){ 61 | roomsAray = new Room[roomNumber]; 62 | double preratio = 0.2; 63 | double ratio = (double)roomNumber * preratio; 64 | 65 | int stringCount = 0; 66 | for (; stringCount < ratio; stringCount++){ 67 | roomsAray[stringCount] = new Room(Room.roomSelect.economic2,"10"+stringCount); 68 | eco2++; 69 | } 70 | 71 | for (; stringCount < (ratio*2) ; stringCount++) { 72 | roomsAray[stringCount] = new Room(Room.roomSelect.economic4,"10"+stringCount); 73 | eco4++; 74 | } 75 | 76 | for (; stringCount < (ratio*3) ; stringCount++) { 77 | roomsAray[stringCount] = new Room(Room.roomSelect.normal2,"10"+stringCount); 78 | nrml2++; 79 | } 80 | 81 | for (; stringCount < (ratio*4) ; stringCount++) { 82 | roomsAray[stringCount] = new Room(Room.roomSelect.normal4,"10"+stringCount); 83 | nrml4++; 84 | } 85 | 86 | for (; stringCount < (ratio*5) ; stringCount++) { 87 | roomsAray[stringCount] = new Room(Room.roomSelect.kingSuit,"10"+stringCount); 88 | kingS++; 89 | } 90 | 91 | System.out.println("The rooms are ready."); 92 | System.out.println("##################"); 93 | 94 | } 95 | 96 | 97 | public void displayHotelInfo(){ 98 | System.out.print("\n------------------------------"); 99 | System.out.println("Hotel Name ="+Name); 100 | System.out.println("Room Number ="+roomNumber); 101 | System.out.println("Hotel Star ="+hotelStar); 102 | 103 | for (int counter=0; counter < 20; counter++) { 104 | roomsAray[counter].Display(); 105 | } 106 | 107 | } 108 | 109 | public void getCustomer() { 110 | 111 | Scanner scan = new Scanner(System.in); 112 | 113 | //------- GET CUSTOMER ------- 114 | System.out.print("NAME ="); 115 | String a = scan.next(); 116 | 117 | System.out.print("SURNAME ="); 118 | String b = scan.next(); 119 | 120 | System.out.print("PROFESSION ="); 121 | String c = scan.next(); 122 | 123 | System.out.print("AGE ="); 124 | String d = scan.next(); 125 | 126 | System.out.println("ROOM TYPE ="); 127 | 128 | System.out.println("economic2"); 129 | System.out.println("economic3"); 130 | System.out.println("economic4"); 131 | System.out.println("normal2"); 132 | System.out.println("normal3"); 133 | System.out.println("normal4"); 134 | System.out.println("KingSuit"); 135 | 136 | String e = scan.next(); 137 | 138 | System.out.println("HOW MANY NIGHT WILL YOU STAY? ="); 139 | 140 | int f = scan.nextInt(); 141 | 142 | System.out.println("CHOSE TARIFF TYPE ="); 143 | 144 | System.out.println("1-justRoom"); 145 | System.out.println("2-halfTariff"); 146 | System.out.println("3-fullTariff"); 147 | System.out.println("4-icludeEverything"); 148 | 149 | String g = scan.next(); 150 | 151 | 152 | 153 | 154 | 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /PT1-Hotel/Hasan Tezcan/HotelTest.java: -------------------------------------------------------------------------------- 1 | package hotel; 2 | 3 | import java.util.Scanner; 4 | 5 | public class HotelTest { 6 | 7 | 8 | 9 | 10 | public static void main(String[] args) { 11 | 12 | 13 | Hotel h1 = new Hotel("tezcan",20,5); 14 | 15 | 16 | h1.displayHotelInfo(); 17 | 18 | //Tezcan.getCustomer(); 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | // Room r1 = new Room(Room.roomSelect.economic2,"oda1"); 30 | // Customer obj1 = new Customer("a","b","S",5,"55",r1 ,5,Customer.Tariff.justRoom); 31 | // 32 | // Hotel h1 = new Hotel(); 33 | // 34 | // 35 | // 36 | // 37 | // 38 | // h1.displayHotelInfo(); 39 | // 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /PT1-Hotel/Hasan Tezcan/Room.java: -------------------------------------------------------------------------------- 1 | package hotel; 2 | 3 | public class Room { 4 | 5 | public enum roomSelect { 6 | economic2("economic", 2, 45), 7 | economic4("economic", 4, 45), 8 | normal2("normal", 2, 70), 9 | normal4("normal", 4, 70), 10 | kingSuit("KingSuit", 2, 150); 11 | 12 | String roomType; 13 | int numberOfPeople; 14 | int oneManOneNigthPrice; 15 | 16 | roomSelect(String roomType, int numberOfPeople, int oneManOneNigthPrice) { //enums constructor.. 17 | this.roomType = roomType; 18 | this.numberOfPeople = numberOfPeople; 19 | this.oneManOneNigthPrice = oneManOneNigthPrice; 20 | } 21 | 22 | String getRoomName() { 23 | return roomType + " " + numberOfPeople; 24 | } 25 | } 26 | 27 | public roomSelect RS; 28 | public String roomName; 29 | 30 | public Room(roomSelect RS,String roomName) { //constructor 31 | this.RS = RS; 32 | this.roomName = roomName; 33 | 34 | } 35 | 36 | public void Display() { 37 | System.out.println("Room Type= " + RS.roomType); 38 | System.out.println("Number Of People= " + RS.numberOfPeople); 39 | System.out.println("Room Number= "+RS.getRoomName()); 40 | System.out.println("Room Price Per a Person= " + RS.oneManOneNigthPrice); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /PT1-Hotel/README.md: -------------------------------------------------------------------------------- 1 | ## Hotel 2 | 3 | Proje fikri: [@batin](https://github.com/batin) 4 | 5 | - Projenin 4 class'tan oluşturulması tavsiye edilir. 6 | Bunlar; 7 |      **1)** Customer 8 |      **2)** Room 9 |      **3)** Hotel 10 |      **4)** HotelTest 11 | 12 | - Hotel uygulamasının aşağıdaki gibi olması istenmektedir. 13 | 14 | **Customer class**'ı; müşterinin adını soyadını, yaşını, mesleğini vb. içermelidir. 15 | 16 | **Room class'ı**; odanın tipini, özelliklerini ve fiyatını içermelidir. Fiyata kalacak olan müşteriye göre indirim uygulanabilir olmalıdır (12 yaş altına %50 indirim). Oda tipleri ekonomik, normal ve kral dairesi şeklinde ayrılabilir. 17 | 18 | **Hotel class'ı**nda; müşteri girişi alınmalıdır (yarım pansiyon, tam pansiyon, her şey dahil, sadece oda, vb.). Kalacak kişi sayısı kullanıcıdan alınıp ona göre oda ayarlayıp fiyatlandırma yapılacak. 19 | Müşteri çıkışı yapılacağında ise, **exit method**'unda ücret gösterilicektir. Bu class'ın içersinde odaya yemek söylemek gibi işlemler yapılabilir (su, içecek, tost, vb.). 20 | Anlık olarak Hotelde kalanları görmek için, **display method**'u oluşturabilirsiniz. Eğer oda dolu ise müşterinin adı ve soyadı(odadan birini yazması yeterli), oda boş ise odanın boş olduğu ekrana basılmalıdır. 21 | 22 | **HotelTest class'ı**nda ise müşteriler oluşturulmalı, kayıtları yapılmalı, odaya içecek ve tost söylenmelidir. Ardından Hotelden çıkışları alınarak toplam ücret ekrana basılmalıdır. 23 | 24 | #### Proje son teslim tarihi: 25 | 26 | *Projenin süresi 1 haftadır. **18 Nisan** tarihine kadar bu klasör altına **IsimSoyisim** şeklinde alt-klasör oluşturarak yüklemeniz beklenmektedir.* 27 | 28 | > İsteğe bağlı olarak, hazırlamış olduğunuz proje hakkında kısa bir rapor oluşturabilirsiniz. 29 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Book.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Book { 4 | String bookno; 5 | HotelRoomService t[][][]; 6 | Laundry l[][][]; 7 | int ff; 8 | Customer cust; 9 | int s1=0,s2=0; 10 | 11 | public String getBookingNumber () { 12 | return bookno; 13 | } 14 | 15 | public void BookNew (Customer c,Luxury ly,Deluxe dx,SuperDeluxe sdx,HotelRoomService tr[][][],Laundry lr[][][],int ily,int flag1,int idx,int flag2,int isdx,int flag3) { 16 | cust=c; 17 | Pay f=new Pay(); 18 | int no,i; 19 | t=tr; 20 | l=lr; 21 | 22 | if(c.type==1) { 23 | if(flag1==0) { 24 | System.out.println("No Luxury Rooms Available"); 25 | Scanner in5=new Scanner(System.in); 26 | System.out.println("Do you want any other room ? Deluxe(2) or SuperDeluxe(3) "); 27 | int g=in5.nextInt(); 28 | if(g==2) 29 | BookDeluxe(c,dx,g,idx,c.ld,c.d); 30 | if(g==3) 31 | BookSuperDeluxe(c,sdx,g,isdx,c.ld,c.d); 32 | } 33 | if(flag1==1) 34 | BookLuxury(c,ly,c.type,ily,c.ld,c.d); 35 | } 36 | 37 | if(c.type==2) { 38 | if(flag2==0) { 39 | System.out.println("No Deluxe Room Available"); 40 | Scanner in6=new Scanner(System.in); 41 | System.out.println("Do you want any other room ? Luxury(1) or SuperDeluxe(3) "); 42 | int g=in6.nextInt(); 43 | if(g==2) 44 | BookLuxury(c,ly,g,ily,c.ld,c.d); 45 | if(g==3) 46 | BookSuperDeluxe(c,sdx,g,isdx,c.ld,c.d); 47 | } 48 | if(flag2==1) 49 | BookDeluxe(c,dx,c.type,idx,c.ld,c.d); 50 | } 51 | 52 | if(c.type==3) { 53 | if(flag3==0) { 54 | System.out.println("No SuperDeluxe Room Available"); 55 | Scanner in5=new Scanner(System.in); 56 | System.out.println("Do you want any other room? Deluxe(2) or Luxury(3) "); 57 | int g=in5.nextInt(); 58 | if(g==2) 59 | BookDeluxe(c,dx,g,idx,c.ld,c.d); 60 | if(g==1) 61 | BookLuxury(c,ly,g,ily,c.ld,c.d); 62 | } 63 | if(flag3==1) 64 | BookSuperDeluxe(c,sdx,c.type,isdx,c.ld,c.d); 65 | } 66 | } 67 | 68 | public void BookLuxury (Customer c,Luxury ly,int type,int ily,int ld,int d) { 69 | Pay f=new Pay(); 70 | ly.statuschange(); 71 | 72 | if(ld==1) { 73 | System.out.println("Single Luxury Room is booked"); 74 | ff= f.calculator(d,ly.rate,ld); 75 | bookno=ily+"lx1"; 76 | BookDisplay(ff,c.name,t[ily][0][0].getTotalCost(),l[ily][0][1].getTotalCost(),bookno); 77 | } 78 | if(ld==2) { 79 | System.out.println("Double Luxury Room is booked"); 80 | ff= f.calculator(d,ly.rate,ld); 81 | bookno=ily+"lx2"; 82 | BookDisplay(ff,c.name,t[ily][1][0].getTotalCost(),l[ily][1][1].getTotalCost(),bookno); 83 | } 84 | } 85 | 86 | public void BookDeluxe (Customer c,Deluxe dx,int type,int idx,int ld,int d) { 87 | dx.statuschange(); 88 | Pay f=new Pay(); 89 | 90 | if(ld==1) { 91 | System.out.println("Single Deluxe Room is booked"); 92 | ff= f.calculator(d,dx.rate,ld); 93 | bookno=idx+"dx1"; 94 | BookDisplay(ff,c.name,t[idx][0][0].getTotalCost(),l[idx][0][1].getTotalCost(),bookno); 95 | } 96 | if(ld==2) { 97 | System.out.println("Double Deluxe Room is booked"); 98 | ff= f.calculator(d,dx.rate,ld); 99 | bookno=idx+"dx2"; 100 | BookDisplay(ff,c.name,t[idx][1][0].getTotalCost(),l[idx][1][1].getTotalCost(),bookno); 101 | } 102 | } 103 | 104 | public void BookSuperDeluxe (Customer c,SuperDeluxe sdx,int type,int isdx,int ld,int d) { 105 | Pay f=new Pay(); 106 | sdx.statuschange(); 107 | 108 | if(ld==1) { 109 | System.out.println("Single Super Deluxe Room is booked"); 110 | ff= f.calculator(d,sdx.rate,ld); 111 | bookno=isdx+"sdx1"; 112 | BookDisplay(ff,c.name,t[isdx][0][0].getTotalCost(),l[isdx][0][1].getTotalCost(),bookno); 113 | } 114 | if(ld==2) { 115 | System.out.println("Double Super Deluxe Room is booked"); 116 | ff= f.calculator(d,sdx.rate,ld); 117 | bookno=isdx+"sdx2"; 118 | BookDisplay(ff,c.name,t[isdx][1][0].getTotalCost(),l[isdx][1][1].getTotalCost(),bookno); 119 | } 120 | } 121 | 122 | public void BookDisplay (int ff,String name,int tr,int lr,String b) { 123 | System.out.println(""); 124 | System.out.println("Booking number "+ bookno); 125 | System.out.println("Customer number "+ cust.no); 126 | System.out.println("Booking Name "+ name); 127 | System.out.println("Pay is "+ ff +"$"); 128 | System.out.println("Total cost of HotelRoomService is "+ tr +"$"); 129 | System.out.println("Total cost of laundry is "+ lr +"$"); 130 | } 131 | 132 | public int getPay () { 133 | return ff; 134 | } 135 | 136 | public String getName () { 137 | return cust.name; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Customer.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Customer { 4 | int no; 5 | String name; 6 | String bookingno; 7 | int nod,type,ld,d; 8 | boolean status; 9 | 10 | Customer () { 11 | no=-1; 12 | name=null; 13 | bookingno=null; 14 | nod=type=ld=d=-1; 15 | status=false; 16 | } 17 | 18 | public void setInitialDetails (int c) { 19 | no=c; 20 | Scanner in = new Scanner(System.in); 21 | System.out.println("Enter name"); 22 | name = in.nextLine(); 23 | System.out.println("Enter room type? \n 1 for Luxury => 500$, \n 2 for Deluxe => 1000$, \n 3 for Superdeluxe => 1500$"); 24 | type = in.nextInt(); 25 | System.out.println("Single Room (1) or Double Room (2) ? "); 26 | ld = in.nextInt(); 27 | System.out.println("Enter number of days ?"); 28 | d = in.nextInt(); 29 | } 30 | 31 | public void setBookingNo (String b) { 32 | bookingno=b; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Deluxe.java: -------------------------------------------------------------------------------- 1 | public class Deluxe { 2 | 3 | int rate; 4 | boolean wifi; 5 | boolean status; 6 | boolean fridge; 7 | boolean jacuzzi; 8 | boolean roomservice; 9 | boolean television; 10 | boolean filmpackage; 11 | 12 | public void set(int r,boolean w,boolean s,boolean f,boolean j,boolean rs,boolean tv,boolean fp) { 13 | rate=r; 14 | wifi=w; 15 | status=s; 16 | fridge=f; 17 | jacuzzi=j; 18 | roomservice=rs; 19 | television=tv; 20 | filmpackage=fp; 21 | } 22 | 23 | public int getRate () { 24 | return rate; 25 | } 26 | 27 | public boolean getStatus () { 28 | return status; 29 | } 30 | 31 | public boolean getWifi () { 32 | return wifi; 33 | } 34 | 35 | public boolean getFridge () { 36 | return fridge; 37 | } 38 | 39 | public boolean getJacuzzi () { 40 | return jacuzzi; 41 | } 42 | 43 | public boolean getRoomservice () { 44 | return roomservice; 45 | } 46 | 47 | public boolean getTelevision () { 48 | return television; 49 | } 50 | 51 | public boolean getFilmpackage () { 52 | return filmpackage; 53 | } 54 | 55 | public void statuschange () { 56 | if(status==true) 57 | status=false; 58 | else 59 | status=true; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/HotelRoomService.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class HotelRoomService { 4 | 5 | int type; 6 | int cost; 7 | int quantity; 8 | String bno; 9 | boolean status; 10 | 11 | public void setDetails () { 12 | Scanner in = new Scanner(System.in); 13 | 14 | System.out.println("Enter type of repast \n 1-) Breakfast \n 2-) Lunch \n 3-) Dinner "); 15 | type = in.nextInt(); 16 | System.out.println("Enter number of portion [ Single(1) || Double(2) ] )"); 17 | quantity = in.nextInt(); 18 | 19 | if(type==1) 20 | cost=10; 21 | else { 22 | if(type==2) 23 | cost=25; 24 | else { 25 | if(type==3) 26 | cost=30; 27 | else 28 | cost=0; 29 | } 30 | } 31 | } 32 | 33 | public int getTotalCost () { 34 | return quantity*cost; 35 | } 36 | 37 | public boolean getStatus () { 38 | return status; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Laundry.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Laundry { 4 | 5 | int type; 6 | int cost; 7 | int quantity; 8 | String bno; 9 | boolean status; 10 | 11 | public void setDetails () { 12 | status=true; 13 | Scanner in = new Scanner(System.in); 14 | 15 | System.out.println("Enter type of wash (1/2/3)"); 16 | type = in.nextInt(); 17 | System.out.println("Enter quantity of clothes"); 18 | quantity = in.nextInt(); 19 | 20 | if(type==1) 21 | cost=50; 22 | else { 23 | if(type==2) 24 | cost=100; 25 | else { 26 | if(type==3) 27 | cost=150; 28 | else 29 | cost=0; 30 | } 31 | } 32 | } 33 | 34 | public int getTotalCost () { 35 | return quantity*cost; 36 | } 37 | 38 | public boolean getStatus () { 39 | return status; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Luxury.java: -------------------------------------------------------------------------------- 1 | public class Luxury { 2 | 3 | int rate; 4 | boolean wifi; 5 | boolean status; 6 | boolean fridge; 7 | boolean jacuzzi; 8 | boolean roomservice; 9 | boolean television; 10 | boolean filmpackage; 11 | 12 | public void set(int r,boolean w,boolean s,boolean f,boolean j,boolean rs,boolean tv,boolean fp) { 13 | rate=r; 14 | wifi=w; 15 | status=s; 16 | fridge=f; 17 | jacuzzi=j; 18 | roomservice=rs; 19 | television=tv; 20 | filmpackage=fp; 21 | } 22 | 23 | public int getRate () { 24 | return rate; 25 | } 26 | 27 | public boolean getStatus () { 28 | return status; 29 | } 30 | 31 | public boolean getWifi () { 32 | return wifi; 33 | } 34 | 35 | public boolean getFridge () { 36 | return fridge; 37 | } 38 | 39 | public boolean getJacuzzi () { 40 | return jacuzzi; 41 | } 42 | 43 | public boolean getRoomservice () { 44 | return roomservice; 45 | } 46 | 47 | public boolean getTelevision () { 48 | return television; 49 | } 50 | 51 | public boolean getFilmpackage () { 52 | return filmpackage; 53 | } 54 | 55 | public void statuschange() { 56 | if(status==true) 57 | status=false; 58 | else 59 | status=true; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Pay.java: -------------------------------------------------------------------------------- 1 | public class Pay { 2 | public int calculator(int days,int rate,int s) { 3 | if(s==1) 4 | return days*rate; 5 | if(s==2) 6 | return days*rate*2; 7 | return 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/README.md: -------------------------------------------------------------------------------- 1 | cd Desktop/hotel/ 2 | 3 | javac *.java 4 | 5 | java Welcome 6 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/SuperDeluxe.java: -------------------------------------------------------------------------------- 1 | public class SuperDeluxe { 2 | 3 | int rate; 4 | boolean wifi; 5 | boolean status; 6 | boolean fridge; 7 | boolean jacuzzi; 8 | boolean roomservice; 9 | boolean television; 10 | boolean filmpackage; 11 | 12 | public void set(int r,boolean w,boolean s,boolean f,boolean j,boolean rs,boolean tv,boolean fp) { 13 | rate=r; 14 | wifi=w; 15 | status=s; 16 | fridge=f; 17 | jacuzzi=j; 18 | roomservice=rs; 19 | television=tv; 20 | filmpackage=fp; 21 | } 22 | 23 | public int getRate () { 24 | return rate; 25 | } 26 | 27 | public boolean getStatus () { 28 | return status; 29 | } 30 | 31 | public boolean getWifi () { 32 | return wifi; 33 | } 34 | 35 | public boolean getFridge () { 36 | return fridge; 37 | } 38 | 39 | public boolean getJacuzzi () { 40 | return jacuzzi; 41 | } 42 | 43 | public boolean getRoomservice () { 44 | return roomservice; 45 | } 46 | 47 | public boolean getTelevision () { 48 | return television; 49 | } 50 | 51 | public boolean getFilmpackage () { 52 | return filmpackage; 53 | } 54 | 55 | public void statuschange() { 56 | if(status==true) 57 | status=false; 58 | else 59 | status=true; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /PT1-Hotel/alperenisik (✔)/Welcome.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Welcome{ 4 | 5 | public static void main(String args[]) { 6 | 7 | int nod,type,bookingno,ld,d; 8 | char ch='y'; 9 | double ff; 10 | String name; 11 | Luxury[] ly = new Luxury[10]; 12 | Deluxe[] dx = new Deluxe[10]; 13 | SuperDeluxe[] sdx= new SuperDeluxe[10]; 14 | Customer c[] = new Customer[30]; 15 | Laundry l[][][]=new Laundry[30][5][5]; 16 | HotelRoomService t[][][]=new HotelRoomService[30][5][5]; 17 | Book b[]=new Book[30]; 18 | int i=0,j,k; 19 | 20 | for(i=0;i<10;i++) { 21 | ly[i]=new Luxury(); 22 | ly[i].set(500,false,false,false,false,true,false,false); 23 | } 24 | 25 | for(i=0;i<10;i++) { 26 | dx[i]=new Deluxe(); 27 | dx[i].set(1000,true,false,true,false,true,true,false); 28 | } 29 | 30 | for(i=0;i<10;i++) { 31 | sdx[i]=new SuperDeluxe(); 32 | sdx[i].set(1500,true,false,true,true,true,true,true); 33 | } 34 | 35 | for(i=0;i<30;i++) { 36 | c[i]=new Customer(); 37 | } 38 | 39 | for(i=0;i<30;i++) { 40 | b[i]=new Book(); 41 | } 42 | 43 | for(i=0;i<30;i++) { 44 | for(j=0;j<5;j++) { 45 | for(k=0;k<5;k++) { 46 | t[i][j][k]=new HotelRoomService(); 47 | l[i][j][k]=new Laundry(); 48 | } 49 | } 50 | } 51 | 52 | String no; 53 | int ic=0,ily=0,ilr=0,itr1=0,itr2=0,isdx=0,idx=0; 54 | int flag1=0,flag2=0,flag3=0; 55 | 56 | while(true) { 57 | System.out.println(""); 58 | System.out.println("What do you want to do ? "); 59 | System.out.println("Book a room ( b ) "); 60 | System.out.println("Avail a service ( s ) "); 61 | System.out.println("Cancel a booked room ( c ) "); 62 | System.out.println("Exit Menu ( e ) "); 63 | 64 | Scanner in = new Scanner(System.in); 65 | ch = in.next(".").charAt(0); 66 | 67 | if(ch=='b') { 68 | 69 | for(i=0;i<3;i++) { 70 | if(ly[i].getStatus()==false) { 71 | ily=i; 72 | flag1=1; 73 | break; 74 | } 75 | else 76 | flag1=0; 77 | } 78 | 79 | for(i=0;i<8;i++) { 80 | if(dx[i].getStatus()==false) { 81 | idx=i; 82 | flag2=1; 83 | break; 84 | } 85 | else 86 | flag2=0; 87 | } 88 | 89 | for(i=0;i<10;i++) { 90 | if(sdx[i].getStatus()==false) { 91 | isdx=i; 92 | flag3=1; 93 | break; 94 | } 95 | else 96 | flag3=0; 97 | } 98 | c[ic].setInitialDetails(ic); 99 | b[ic].BookNew(c[ic],ly[ily],dx[idx],sdx[isdx],t,l,ily,flag1,idx,flag2,isdx,flag3); 100 | c[ic].setBookingNo(b[ic].getBookingNumber()); 101 | ic++; 102 | } 103 | 104 | 105 | if(ch=='c') { 106 | ic--; 107 | Scanner in2 = new Scanner(System.in); 108 | System.out.println("Enter your booking no : "); 109 | no = in2.nextLine(); 110 | 111 | int no1=(int)no.charAt(0)-48; 112 | int no2; 113 | 114 | System.out.println("Enter type \n 1-) Luxury \n 2-) Deluxe \n 3-) SuperDeluxe \n"); 115 | no2= in2.nextInt(); 116 | 117 | if(no2==1) { 118 | ly[no1].statuschange(); 119 | } 120 | 121 | if(no2==2) { 122 | dx[no1].statuschange(); 123 | } 124 | 125 | if(no2==3) { 126 | sdx[no1].statuschange(); 127 | } 128 | 129 | System.out.println("Cancelled"); 130 | } 131 | 132 | int cno; 133 | 134 | if(ch=='s') { 135 | Scanner in2 = new Scanner(System.in); 136 | 137 | System.out.println("Enter your booking no : "); 138 | no = in2.nextLine(); 139 | 140 | System.out.println("Enter your customer no : "); 141 | cno = in2.nextInt(); 142 | 143 | System.out.println("Enter the service required ( HotelRoomService (1) / Laundry (2) )"); 144 | int a = in2.nextInt(); 145 | 146 | // booking no 147 | itr1 = (int)(no.charAt(0))-48; 148 | 149 | // single or double 150 | if(no.charAt(1)=='s') 151 | itr2= (int)(no.charAt(4))-48; 152 | else 153 | itr2= (int)(no.charAt(3))-48; 154 | 155 | 156 | if(a==1) { 157 | t[itr1][itr2][0].setDetails(); 158 | b[cno].s1=b[cno].s1+(t[itr1][itr2][0].getTotalCost()); 159 | b[cno].BookDisplay(b[cno].ff,c[cno].name,b[cno].s1,b[cno].s2,no); 160 | } 161 | 162 | if(a==2) { 163 | l[itr1][itr2][1].setDetails(); 164 | b[cno].s2=b[cno].s2+l[itr1][itr2][1].getTotalCost(); 165 | b[cno].BookDisplay(b[cno].ff,c[cno].name,b[cno].s1,b[cno].s2,no); 166 | } 167 | } 168 | 169 | if(ch=='e') 170 | break; 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /PT1-Hotel/boratanrikulu (✔)/Customer.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | public class Customer { 7 | 8 | /* instance variables */ 9 | private String name; 10 | private String surname; 11 | private int age; 12 | private String job; 13 | 14 | /* constructor */ 15 | public Customer(String name, String surname, int age, String job) { 16 | if(age < 1) 17 | throw new IllegalArgumentException("(!) age must be at least 1."); 18 | if(age > 140) 19 | throw new IllegalArgumentException("(!) age must be at most 140."); 20 | if(name.equals("")) 21 | throw new IllegalArgumentException("(!) name not entered."); 22 | if(surname.equals("")) 23 | throw new IllegalArgumentException("(!) surname not entered."); 24 | if(job.equals("")) 25 | throw new IllegalArgumentException("(!) job not entered."); 26 | 27 | this.name = name; 28 | this.surname = surname; 29 | this.age = age; 30 | this.job = job; 31 | } 32 | 33 | /* methods */ 34 | public String display() { 35 | return this.name+" "+this.surname+", "+this.age+" years old, "+this.job; 36 | } 37 | 38 | /* setters */ 39 | public void setName(String name) { 40 | this.name = name; 41 | } 42 | public void setSurname(String surname) { 43 | this.surname = surname; 44 | } 45 | public void setAge(int age) { 46 | this.age = age; 47 | } 48 | public void setJob(String job) { 49 | this.job = job; 50 | } 51 | /* getters */ 52 | public String getName() { 53 | return this.name; 54 | } 55 | public String getSurname() { 56 | return this.surname; 57 | } 58 | public int getAge() { 59 | return this.age; 60 | } 61 | public String getJob() { 62 | return this.job; 63 | } 64 | } -------------------------------------------------------------------------------- /PT1-Hotel/boratanrikulu (✔)/Menu.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | import java.util.Scanner; 7 | 8 | public class Menu { 9 | 10 | public static void main(String[] args) { 11 | Menu menu = new Menu(); 12 | menu.startMenu(); 13 | } 14 | 15 | public void startMenu() { 16 | Scanner scan = new Scanner(System.in); 17 | // objects 18 | /* 19 | ┌────────────────────────────── 5 Economic Rooms 20 | │ ┌─────────────────────────── 8 Normal Rooms 21 | │ │ ┌──────────────────────── 2 Royal Rooms 22 | │ │ │ ┌───────────────────── 30$ for Economic Rooms 23 | │ │ │ │ ┌───────────────── 75$ for Normal Rooms 24 | │ │ │ │ │ ┌───────────── 250$ for Royal Rooms 25 | │ │ │ │ │ │ 26 | │ │ │ │ │ │ */ 27 | Hotel hotel = new Hotel("TANRIKULU HOTEL", "Bora Tanrikulu", 3, 4, 2, 30, 75, 250); 28 | 29 | 30 | while(true) { 31 | clear(); 32 | for(int counter=0; counter<(hotel.getHotelName().length()+16); counter++) 33 | System.out.print("#"); 34 | System.out.println("\n# "+ hotel.getHotelName() +" #"); 35 | System.out.println("#"); 36 | System.out.println("# 1) Make Reservation"); 37 | System.out.println("# 2) Manage Your Reservation"); 38 | System.out.println("# 3) Show All Rooms"); 39 | System.out.println("#"); 40 | String temp = "# 9) Exit"; 41 | System.out.print(temp); 42 | for(int counter=0; counter<(hotel.getHotelName().length()+16-(temp.length()+1)); counter++) 43 | System.out.print(" "); 44 | System.out.print("#\n"); 45 | for(int counter=0; counter<(hotel.getHotelName().length()+16); counter++) 46 | System.out.print("#"); 47 | System.out.print("\n\t Menu Option: "); int menuOption = scan.nextInt(); 48 | scan.nextLine(); 49 | switch(menuOption) { 50 | case 1: 51 | clear(); 52 | hotel.bookingMenu(); 53 | break; 54 | case 2: 55 | clear(); 56 | hotel.startManageReservation(); 57 | break; 58 | case 3: 59 | clear(); 60 | hotel.displayAll(); 61 | break; 62 | case 9: 63 | System.exit(0); 64 | break; 65 | default: 66 | System.out.print("\n(!) Select appropriate menu options."); 67 | scan.nextLine(); 68 | break; 69 | } 70 | } 71 | } 72 | 73 | public void clear() { 74 | System.out.print("\033[H\033[2J"); 75 | System.out.flush(); 76 | } 77 | } -------------------------------------------------------------------------------- /PT1-Hotel/boratanrikulu (✔)/README.md: -------------------------------------------------------------------------------- 1 | use the following command to use the program: 2 | 3 | ``` 4 | cd /path/to/PT1-Hotel/boratanrikulu/ 5 | javac *.java && java Menu 6 | ``` 7 | -------------------------------------------------------------------------------- /PT1-Hotel/boratanrikulu (✔)/Room.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | public class Room { 7 | 8 | /* instance variables */ 9 | enum RoomType { 10 | ECONOMIC("Ecomomic Room", "> Our lowest priced room. Does not include anything except the bed!\n# We recommend you only if you need somewhere to stay."), 11 | NORMAL("Normal Room", "> Our average priced room has products for general needs in the room.\n# Also breakfast is free with the Normal Room."), 12 | ROYAL("Royal Room", "> Are you a member of a royal ?. Than come baby!\n# But this room is extremely expensive!"); 13 | 14 | /* constructor */ 15 | String name; 16 | String feature; 17 | RoomType(String name, String feature){ 18 | this.name = name; 19 | this.feature = feature; 20 | } 21 | 22 | /* getters */ 23 | String getRoomFeature() { 24 | return this.feature; 25 | } 26 | String getRoomName() { 27 | return this.name; 28 | } 29 | 30 | } 31 | enum RoomStatus { 32 | NONAVAILABLE("NOT available"), 33 | AVAILABLE("available"); 34 | 35 | String status; 36 | RoomStatus(String status) { 37 | this.status = status; 38 | } 39 | 40 | String getRoomStatus() { 41 | return this.status; 42 | } 43 | } 44 | private int price; 45 | public RoomStatus roomStatus; 46 | public Customer customer; 47 | public RoomType roomType; 48 | 49 | /* constructor */ 50 | public Room(RoomType roomType, int price) { 51 | this.price = price; 52 | this.roomType = roomType; 53 | this.roomStatus = RoomStatus.AVAILABLE; 54 | } 55 | public Room() { 56 | } 57 | 58 | /* methods */ 59 | public String displayCustomer() { 60 | return customer.display(); 61 | } 62 | 63 | /* setters */ 64 | public void setRoomType(RoomType roomType) { 65 | this.roomType = roomType; 66 | } 67 | public void setCustomer(Customer customer) { 68 | this.customer = customer; 69 | this.roomStatus = RoomStatus.NONAVAILABLE; 70 | } 71 | public void addPrice(int price) { 72 | this.price += price; 73 | } 74 | /* getters */ 75 | public int getPrice(){ 76 | return this.price; 77 | } 78 | public Customer getCustomer() { 79 | return this.customer; 80 | } 81 | } -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/Book.java: -------------------------------------------------------------------------------- 1 | package project2; 2 | /** 3 | * 4 | * @author BATIN 5 | */ 6 | public class Book { 7 | private String Name; 8 | private int Price; 9 | 10 | public Book(String Name, int Price) { 11 | this.Name = Name; 12 | this.Price = Price; 13 | } 14 | 15 | public String getName() { 16 | return Name; 17 | } 18 | 19 | public void setName(String Name) { 20 | this.Name = Name; 21 | } 22 | 23 | public int getPrice() { 24 | return Price; 25 | } 26 | 27 | public void setPrice(int Price) { 28 | this.Price = Price; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return String.format("Book Name: %15s || Book Price: %3d$",Name,Price); 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/BookStoreTest.java: -------------------------------------------------------------------------------- 1 | package project2; 2 | 3 | /** 4 | * 5 | * @author BATIN 6 | */ 7 | public class BookStoreTest { 8 | 9 | public static void main(String[] args) { 10 | BookStore DR = new BookStore("D&R"); 11 | //DR.Buy(); 12 | //DR.ShowSections(); 13 | // DR.Booklist(); 14 | // DR.Buy(); 15 | // DR.Booklist(); 16 | //DR.Sell(); 17 | // DR.Booklist(); 18 | //DR.Hire(); 19 | //DR.EmployeeList(); 20 | boolean flag = true; 21 | while (flag) { 22 | System.out.println("1 to Buy from Supply"); 23 | System.out.println("2 to Sell to Customer"); 24 | System.out.println("3 to Hire an Emplloyee"); 25 | System.out.println("4 to Fire an Emplloyee"); 26 | System.out.println("5 to See List of Books"); 27 | System.out.println("6 to See List of Emplloyees"); 28 | System.out.println("7 to See The Sections"); 29 | System.out.println("8 to EXIT"); 30 | int choice = DR.GetInteger(8); 31 | switch (choice) { 32 | case 1: 33 | DR.Buy(); 34 | break; 35 | case 2: 36 | DR.Sell(); 37 | break; 38 | case 3: 39 | DR.Hire(); 40 | break; 41 | case 4: 42 | DR.Firing(); 43 | break; 44 | case 5: 45 | DR.Booklist(); 46 | break; 47 | case 6: 48 | DR.EmployeeList(); 49 | break; 50 | case 7: 51 | DR.ShowSections(); 52 | break; 53 | case 8: 54 | flag = false; 55 | break; 56 | default: 57 | System.out.println("Wrong"); 58 | break; 59 | } 60 | 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/Employee.java: -------------------------------------------------------------------------------- 1 | package project2; 2 | 3 | /** 4 | * 5 | * @author BATIN 6 | */ 7 | public abstract class Employee { 8 | 9 | protected final String Name; 10 | protected final String Surname; 11 | 12 | public enum Sex { 13 | FEMALE, 14 | MALE 15 | } 16 | protected final Sex sex; 17 | protected final int HourlySalary;//hourly 18 | protected final int Hours; 19 | protected int Salary; 20 | 21 | public Employee(String Name, String Surname, Sex sex, int HourlySalary, int Hours) { 22 | this.Name = Name; 23 | this.Surname = Surname; 24 | this.sex = sex; 25 | this.HourlySalary = HourlySalary; 26 | this.Hours = Hours; 27 | } 28 | 29 | public String getName() { 30 | return Name; 31 | } 32 | 33 | public String getSurname() { 34 | return Surname; 35 | } 36 | 37 | public Sex getSex() { 38 | return sex; 39 | } 40 | 41 | public int getSalary() { 42 | return HourlySalary; 43 | } 44 | 45 | public int getHours() { 46 | return Hours; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return String.format("Name: %10s || Surname: %10s || Sex: %10s || Salary: %10s || Hours: %10s ", Name, Surname, sex, HourlySalary, Hours); 52 | } 53 | 54 | public void salary() { 55 | 56 | if (this.Hours % 40 > 0) { 57 | Salary += (HourlySalary*1.5) * (Hours % 40); 58 | Salary += HourlySalary*40; 59 | } else { 60 | Salary += HourlySalary * Hours; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/FantasticSection.java: -------------------------------------------------------------------------------- 1 | 2 | package project2; 3 | 4 | import java.util.ArrayList; 5 | /** 6 | * 7 | * @author BATIN 8 | */ 9 | public class FantasticSection extends Section { 10 | 11 | public FantasticSection( int BookCount, Staff staff, ArrayList booklist) { 12 | super(BookCount, staff, booklist); 13 | } 14 | 15 | @Override 16 | public void Display() { 17 | System.out.println("##Fantastic Section##"); 18 | super.Display(); 19 | } 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/LiteratureSection.java: -------------------------------------------------------------------------------- 1 | 2 | package project2; 3 | 4 | import java.util.ArrayList; 5 | /** 6 | * 7 | * @author BATIN 8 | */ 9 | public class LiteratureSection extends Section { 10 | 11 | public LiteratureSection(int BookCount, Staff staff, ArrayList booklist) { 12 | super(BookCount, staff, booklist); 13 | } 14 | 15 | 16 | @Override 17 | public void Display() { 18 | System.out.println("##Philosophy Section##"); 19 | super.Display(); 20 | } 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/PhilosophySection.java: -------------------------------------------------------------------------------- 1 | 2 | package project2; 3 | 4 | import java.util.ArrayList; 5 | /** 6 | * 7 | * @author BATIN 8 | */ 9 | public class PhilosophySection extends Section{ 10 | 11 | public PhilosophySection(int BookCount, Staff staff, ArrayList booklist) { 12 | super(BookCount, staff, booklist); 13 | } 14 | 15 | @Override 16 | public void Display() { 17 | System.out.println("##Philosophy Section##"); 18 | super.Display(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/README.md: -------------------------------------------------------------------------------- 1 | For Questions About Project 2 2 | --- 3 | * [Q&A](https://github.com/orgs/java-util-help/teams/q-a) 4 | * [My Site](http://btnerylmz.me) 5 | * @btnerylmz (Telegram) 6 | --- 7 | Any Suggestions Are Welcome and Appreciated 8 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/SciFiSection.java: -------------------------------------------------------------------------------- 1 | 2 | package project2; 3 | 4 | import java.util.ArrayList; 5 | /** 6 | * 7 | * @author BATIN 8 | */ 9 | public class SciFiSection extends Section { 10 | 11 | public SciFiSection(int BookCount, Staff staff, ArrayList booklist) { 12 | super(BookCount, staff, booklist); 13 | } 14 | 15 | @Override 16 | public void Display() { 17 | System.out.println("##Sci-Fi Section##"); 18 | super.Display(); 19 | } 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/Section.java: -------------------------------------------------------------------------------- 1 | 2 | package project2; 3 | 4 | import java.util.ArrayList; 5 | /** 6 | * 7 | * @author BATIN 8 | */ 9 | public abstract class Section { 10 | protected final int BookCount; 11 | protected Staff staff; 12 | 13 | protected ArrayList booklist = new ArrayList(); 14 | 15 | public Section(int BookCount, Staff staff, ArrayList booklist) { 16 | this.BookCount = BookCount; 17 | this.staff = staff; 18 | 19 | booklist.forEach((book) -> { //arraylistlere ozel bir foreach (cool di mi? :D) 20 | this.booklist.add(book); 21 | }); 22 | 23 | } 24 | 25 | public ArrayList getBooklist() { 26 | return booklist; 27 | } 28 | 29 | public Staff getStaff() { 30 | return staff; 31 | } 32 | 33 | public void setStaff(Staff staff) { 34 | this.staff = staff; 35 | } 36 | 37 | public int getBookCount() { 38 | return BookCount; 39 | } 40 | public void AddBook(Book book) { 41 | this.booklist.add(book); 42 | } 43 | 44 | 45 | public void Display() { 46 | System.out.printf("BookCount: %5d Staff: %s \n",BookCount,staff.getName()); 47 | booklist.forEach((Book book) -> { 48 | System.out.printf("\t Book Name: %15s || Book Price: %5d $\n7",book.getName(),book.getPrice()); 49 | }); 50 | 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/Staff.java: -------------------------------------------------------------------------------- 1 | package project2; 2 | /** 3 | * 4 | * @author BATIN 5 | */ 6 | public class Staff extends Employee { 7 | 8 | public Staff(String Name, String Surname, Sex sex, int HourlySalary, int Hours) { 9 | super(Name, Surname, sex, HourlySalary, Hours); 10 | } 11 | 12 | @Override 13 | public String toString() { 14 | return super.toString() + "|| Type: Staff"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /PT2-Bookstore/Batın Eryılmaz (✔)/SuperVisor.java: -------------------------------------------------------------------------------- 1 | package project2; 2 | 3 | /** 4 | * 5 | * @author BATIN 6 | */ 7 | public class SuperVisor extends Employee { 8 | 9 | private final int BaseSalary; 10 | 11 | public SuperVisor(String Name, String Surname, Sex sex, int HourlySalary, int Hours, int BaseSalary) { 12 | super(Name, Surname, sex, HourlySalary, Hours); 13 | this.BaseSalary = BaseSalary; 14 | } 15 | 16 | @Override 17 | public void salary() { 18 | super.salary(); 19 | this.Salary += BaseSalary; 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | return super.toString() + "|| Type: SuperVisor"; 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /PT2-Bookstore/README.md: -------------------------------------------------------------------------------- 1 | ## BookStore 2 | 3 | Proje fikri: [@batin](https://github.com/batin) 4 | 5 | - Projenin 11 class'tan oluşturulması tavsiye edilir. 6 | Bunlar; 7 | 8 | * **Section (Abstract)** 9 | * **Sci-Fi** 10 | * **Fantastic** 11 | * **Philosophy** 12 | * **Literature** 13 | * **Employee (Abstract)** 14 | * **Staff** 15 | * **SuperVisor** 16 | * **BookStore** 17 | * **BookStoreTest** 18 | * **Book** 19 | 20 | 21 | - BookStore uygulamasının aşağıdaki gibi olması istenmektedir. 22 | 23 | **Section class'ı**; bölümün kitap sayısı, bölüm çalışanlarını vb. içermelidir. *Abstract class* biçiminde yazılmalıdır. 24 | 25 | **Section subclass'ları**nda; her subclass'ta farklı türde bir indirim uygulanması istenmektedir ve her bölümün çalışanı olmalıdır. O bölümden kitap alınacağı zaman *"Merhaba ben Batın. Hangi kitabı almak istersiniz?"* gibi bir mesaj ekrana bastırılmalıdır. 26 | 27 | **Employee class'ı**nda; çalışanın adı, soyadı, cinsiyeti(enum tipi önerilir), saatlik maaşı, haftalık çalıştığı saat ve çalıştığı bölüm bulunmalıdır. *Abstract class* biçiminde yazılmalıdır. Maaşları hesaplama metodu olmalıdır. (Haftalık 40 saati geçen çalışanlar her saat için 1.5 kat ücret alabilirler.) 28 | 29 | **Employee subclass'ları**nda; çalışanların maaş hesaplamaları farklı olması için *override* ederek method'lar oluşturulmalıdır. (Belli bir maaş sabit maaşı olur üstüne diğer çalısanlar gibi saatlik maaş alır.) 30 | 31 | **BookStore class'ı**nda; Mağaza ismi olmalıdır. Kitap alma(toptancıdan), kitap satma(müşteriye), kitap görüntüleme, bölüm görüntüleme, çalışan ekleme, çalışan çıkarma, çalışan görüntüleme metotları bulunmalıdır. 32 | 33 | **BookStoreTest class'ı**, menü içermelidir. 34 | 35 | **Book class'ı**nda kitabın ismi ve fiyatı olmalıdır. 36 | 37 | **Note**; Hiçbir bölümde kitap sınırlaması olmamalıdır. Gerektiğinde 100000 tane bilim kurgu kitabı girilebilir şekilde bi oluşturulması istenmektedir.(Öneri: ArrayList) 38 | 39 | #### Proje son teslim tarihi: 40 | 41 | *Projenin süresi 1 haftadır. **1 Mayıs (23:59)** tarihine kadar bu klasör altına **IsimSoyisim** şeklinde alt-klasör oluşturarak yüklemeniz beklenmektedir. Esinlenmenin olmaması için lütfen en erken **28 Nisan** tarihinde yükleyiniz.* 42 | 43 | **!** Proje hakkında aklınıza takılan bir yer var ise; 44 |      Üyeler - [Soru&Cevap](https://github.com/orgs/java-util-help/teams/q-a) 45 |      Üye olmayanlar, proje üzerinde **issue** açarak sorabilirler - [Issues](https://github.com/java-util-help/projects/issues) 46 | 47 | > İsteğe bağlı olarak, hazırlamış olduğunuz proje hakkında kısa bir rapor oluşturabilirsiniz. 48 | -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Employees/Staff.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | 8 | public class Staff extends Employee { 9 | 10 | public Staff(String name, Employee.Gender gender, int weeklyHours, int hourlySalary) { 11 | super(name, gender, weeklyHours, hourlySalary); 12 | } 13 | 14 | public Staff() { 15 | // to create a null employee 16 | super(); 17 | } 18 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Employees/SuperVisor.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | 8 | public class SuperVisor extends Employee { 9 | 10 | public SuperVisor(String name, Employee.Gender gender, int weeklyHours, int hourlySalary) { 11 | super(name, gender, weeklyHours, hourlySalary); 12 | } 13 | 14 | public SuperVisor() { 15 | // to create a null employee 16 | super(); 17 | } 18 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Mains/Book.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | 8 | public class Book { 9 | 10 | private final String title; 11 | private final String author; 12 | private final String publishDate; 13 | private int price; 14 | 15 | // constructor 16 | public Book(String title, String author, String publishDate, int price) { 17 | if(title.equals("")) 18 | throw new IllegalArgumentException("(!) The Book Title is not entered."); 19 | if(author.equals("")) 20 | throw new IllegalArgumentException("(!) The Author of The Book is not entered."); 21 | if(publishDate.equals("")) 22 | throw new IllegalArgumentException("(!) The Publish Date of The Book is not entered."); 23 | if(price < 0) 24 | throw new IllegalArgumentException("(!) The Price of The Book can not be negative."); 25 | 26 | this.title = title; 27 | this.author = author; 28 | this.publishDate = publishDate; 29 | this.price = price; 30 | } 31 | 32 | // setters 33 | public void setPrice(int price) { 34 | if(price < 0) 35 | throw new IllegalArgumentException("(!) The Price of The Book can not be negative."); 36 | 37 | this.price = price; 38 | } 39 | // getters 40 | public String getTitle() { 41 | return this.title; 42 | } 43 | public String getAuthor() { 44 | return this.author; 45 | } 46 | public String getPublishDate() { 47 | return this.publishDate; 48 | } 49 | public int getPrice() { 50 | return this.price; 51 | } 52 | 53 | // toString 54 | public String toString() { 55 | return String.format("[%d$] \"%s\" by %s, published in %s", this.price, this.title.toUpperCase(), this.author, this.publishDate); 56 | } 57 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Mains/Employee.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | 8 | public abstract class Employee { 9 | 10 | enum Gender { 11 | M("Male"), 12 | F("Female"), 13 | NULL("NULL"); 14 | 15 | String gender; 16 | Gender(String gender) { 17 | this.gender = gender; 18 | } 19 | 20 | String getGender() { 21 | return this.gender; 22 | } 23 | } 24 | private final String name; 25 | private final Gender gender; 26 | private int weeklyHours; 27 | private int hourlySalary; 28 | 29 | // constuctor 30 | public Employee(String name, Gender gender, int weeklyHours, int hourlySalary) { 31 | if(name.equals("")) 32 | throw new IllegalArgumentException("(!) The Name of The Employee is not entered."); 33 | if(gender.getGender().equals("")) 34 | throw new IllegalArgumentException("(!) The Gender of The Employee is not entered."); 35 | if(weeklyHours < 0) 36 | throw new IllegalArgumentException("(!) The Weekly Hours of The Employee can not be negative."); 37 | if(hourlySalary < 0) 38 | throw new IllegalArgumentException("(!) The Hourly Salary of The Employee can not be negative."); 39 | 40 | this.name = name; 41 | this.gender = gender; 42 | this.weeklyHours = weeklyHours; 43 | this.hourlySalary = hourlySalary; 44 | } 45 | 46 | public Employee() { 47 | this.name = null; 48 | this.gender = Gender.NULL; 49 | this.weeklyHours = 0; 50 | this.hourlySalary = 0; 51 | } 52 | 53 | // setters 54 | public void setWeeklyHours(int weeklyHours) { 55 | if(weeklyHours < 0) 56 | throw new IllegalArgumentException("(!) The Weekly Hours of The Employee can not be negative."); 57 | 58 | this.weeklyHours = weeklyHours; 59 | } 60 | public void setHourlySalary(int hourlySalary) { 61 | if(hourlySalary < 0) 62 | throw new IllegalArgumentException("(!) The Hourly Salary of The Employee can not be negative."); 63 | 64 | this.hourlySalary = hourlySalary; 65 | } 66 | // getters 67 | public String getName() { 68 | return this.name; 69 | } 70 | public Gender getGender() { 71 | return gender; 72 | } 73 | public int getSalary() { 74 | return weeklyHours*hourlySalary; 75 | } 76 | 77 | // toString 78 | public String toString() { 79 | return String.format("%s [%s], %s$ at a week", this.name, this.gender, (this.weeklyHours*this.hourlySalary)); 80 | } 81 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Mains/Menu.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | import java.util.Scanner; 8 | 9 | public class Menu { 10 | private Scanner scan; 11 | private BookStore bookstore; 12 | 13 | public static void main(String[] args) { 14 | Menu menu = new Menu(); 15 | menu.startMenu(); 16 | } 17 | 18 | private void startMenu() { 19 | scan = new Scanner(System.in); 20 | bookstore = new BookStore("Tanrikulu BookStore", 1000, 0.7); 21 | 22 | while(true) { 23 | clear(); 24 | String temp = "##########################################################################"; 25 | System.out.println("##########################################################################"); 26 | System.out.print("# "); 27 | for(int counter=0; counter<((temp.length()-bookstore.getName().length())/2)-2; counter++) { 28 | System.out.print(" "); 29 | } 30 | System.out.print("#" + bookstore.getName() + "#"); 31 | for(int counter=0; counter<((temp.length()-bookstore.getName().length())/2)-2; counter++) { 32 | System.out.print(" "); 33 | } 34 | System.out.print("#\n"); 35 | System.out.println("# "); 36 | System.out.println("# 1) Add or Sell Books"); 37 | System.out.println("# 2) Manage Employees"); 38 | 39 | System.out.println("# "); 40 | System.out.printf("# 9) Terminate The BookStore The Money Case: %9.2f$ #\n", bookstore.getMoneyCase()); 41 | System.out.println("##########################################################################"); 42 | System.out.print("\t Menu Option: "); String menuOption = scan.nextLine(); 43 | 44 | switch(menuOption) { 45 | case "1": 46 | book(); 47 | break; 48 | case "2": 49 | employee(); 50 | break; 51 | case "9": 52 | System.exit(0); 53 | break; 54 | default: 55 | System.out.print("\n(!) Select appropriate menu options."); 56 | scan.nextLine(); 57 | break; 58 | } 59 | } 60 | } 61 | 62 | private void book() { 63 | boolean flag = true; 64 | 65 | while(flag) { 66 | clear(); 67 | System.out.println("##########################################################################"); 68 | System.out.println("# Which Option Do You Want to Choose ? #"); 69 | System.out.println("# "); 70 | System.out.println("# 1) Add A Book"); 71 | System.out.println("# 2) Sell A Book"); 72 | System.out.println("# 3) Show All Books"); 73 | System.out.println("# "); 74 | System.out.println("# 9) Return to Main Menu #"); 75 | System.out.println("##########################################################################"); 76 | System.out.print("\t Menu Option: "); String menuOption = scan.nextLine(); 77 | 78 | switch(menuOption) { 79 | case "1": 80 | clear(); 81 | bookstore.addABook(); 82 | break; 83 | case "2": 84 | clear(); 85 | bookstore.sellABook(); 86 | break; 87 | case "3": 88 | clear(); 89 | bookstore.showAllBooks(); 90 | System.out.print("\n(->) Push enter to return Upper Menu."); 91 | scan.nextLine(); 92 | break; 93 | case "9": 94 | flag = false; 95 | break; 96 | default: 97 | System.out.print("\n(!) Select appropriate menu options."); 98 | scan.nextLine(); 99 | break; 100 | } 101 | } 102 | } 103 | 104 | private void employee() { 105 | boolean flag = true; 106 | 107 | while(flag) { 108 | clear(); 109 | System.out.println("##########################################################################"); 110 | System.out.println("# Which Option Do You Want to Choose ? #"); 111 | System.out.println("# "); 112 | System.out.println("# 1) Change/Hire A Employee"); 113 | System.out.println("# 2) Fire A Employee"); 114 | System.out.println("# 3) Show All Employees"); 115 | System.out.println("# "); 116 | System.out.println("# 9) Return to Main Menu #"); 117 | System.out.println("##########################################################################"); 118 | System.out.print("\t Menu Option: "); String menuOption = scan.nextLine(); 119 | 120 | switch(menuOption) { 121 | case "1": 122 | bookstore.hireAEmployee(); 123 | clear(); 124 | break; 125 | case "2": 126 | bookstore.fireAEmployee(); 127 | clear(); 128 | break; 129 | case "3": 130 | clear(); 131 | bookstore.showAllEmployees(); 132 | System.out.print("\n(->) Push enter to return Upper Menu."); 133 | scan.nextLine(); 134 | break; 135 | case "9": 136 | flag = false; 137 | break; 138 | default: 139 | System.out.print("\n(!) Select appropriate menu options."); 140 | scan.nextLine(); 141 | break; 142 | } 143 | } 144 | } 145 | 146 | private void clear() { 147 | System.out.print("\033[H\033[2J"); 148 | System.out.flush(); 149 | } 150 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Mains/Section.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | import java.util.ArrayList; 8 | 9 | public abstract class Section { 10 | 11 | private final String name; 12 | private ArrayList books; 13 | private Employee employee; 14 | 15 | // constructor 16 | public Section(String name, Employee employee) { 17 | if(name.equals("")) 18 | throw new IllegalArgumentException("(!) The Name of The Section is not entered."); 19 | if(employee.getName().equals("")) 20 | throw new IllegalArgumentException("(!) The Employee is not sent."); 21 | 22 | this.name = name; 23 | this.employee = employee; 24 | } 25 | 26 | // setters 27 | public void setBooks(ArrayList books) { 28 | this.books = books; 29 | } 30 | public void setEmployee(Employee employee) { 31 | this.employee = employee; 32 | } 33 | // getters 34 | public String getName() { 35 | return this.name; 36 | } 37 | public Book getBook(int count) { 38 | return books.get(count); 39 | } 40 | public int getBooksNumber() { 41 | return books.size()-1; 42 | } 43 | public ArrayList getBooks() { 44 | return this.books; 45 | } 46 | public Employee getEmployee() { 47 | return this.employee; 48 | } 49 | 50 | // methods 51 | public void addABook(Book book) { 52 | this.books.add(book); 53 | } 54 | public void hireAEmployee(Employee employee) { 55 | this.employee = employee; 56 | } 57 | public void sellABook(int count) { 58 | this.books.remove(count); 59 | } 60 | public void fireAEmployee(Employee employee) { 61 | hireAEmployee(employee); 62 | } 63 | 64 | // toStrings 65 | public void showTheBooks() { 66 | int counter = 0; 67 | System.out.println("# " + this.name.toUpperCase() + " >"); 68 | if(getBooksNumber() >= 0) 69 | for(Book temp : books) { 70 | System.out.println("# " + (++counter) + ") " + temp.toString()); 71 | } 72 | else 73 | System.out.println("# THIS SECTION HAS NOT ANY BOOKS."); 74 | } 75 | 76 | public void showTheEmployees() { 77 | System.out.println("# The Staff of " + this.name + " Section >"); 78 | if(employee.getName() != null) 79 | System.out.println("# - " + employee.toString()); 80 | else 81 | System.out.println("# THIS SECTION HAS NOT A EMPLOYEE."); 82 | } 83 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/README.md: -------------------------------------------------------------------------------- 1 | ### Usage Example 2 | 3 |

4 | 5 |

6 | 7 | **use the following commands to use the program** 8 | 9 | ``` 10 | cd /path/to/PT2-BookStore/boratanrikulu/ 11 | javac */*.java -d . 12 | java bookstore.Menu 13 | ``` 14 | -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Sections/History.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | import java.util.ArrayList; 8 | 9 | public class History extends Section { 10 | 11 | // temps to create default sections 12 | private Book bookTemp; 13 | private ArrayList booksTemp; 14 | 15 | // constructor 16 | public History(Employee employee) { 17 | super("History", employee); 18 | 19 | buildHistorySection(); 20 | } 21 | 22 | private void buildHistorySection() { 23 | // creates default books and adds 24 | this.booksTemp = new ArrayList(); 25 | 26 | this.bookTemp = new Book("Türklerin Tarihi - I", "Ilber Ortaylı", "2015", 40); 27 | this.booksTemp.add(this.bookTemp); 28 | 29 | this.bookTemp = new Book("NUTUK", "Atatürk", "1927", 40); 30 | this.booksTemp.add(this.bookTemp); 31 | 32 | // sends arraylist to the history section 33 | setBooks(this.booksTemp); 34 | } 35 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Sections/Mythology.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | import java.util.ArrayList; 8 | 9 | public class Mythology extends Section { 10 | 11 | // temps to create default sections 12 | private Book bookTemp; 13 | private ArrayList booksTemp; 14 | 15 | // constructor 16 | public Mythology(Employee employee) { 17 | super("Mythology", employee); 18 | 19 | buildMythologySection(); 20 | } 21 | 22 | private void buildMythologySection() { 23 | // creates default books and adds 24 | this.booksTemp = new ArrayList(); 25 | this.bookTemp = new Book("Mythology", "Edith Hamilton", "1942", 39); 26 | this.booksTemp.add(this.bookTemp); 27 | this.bookTemp = new Book("The Prose Edda", "Snorri Sturluson", "1220", 34); 28 | this.booksTemp.add(this.bookTemp); 29 | 30 | // sends arraylist to the mythology section 31 | setBooks(this.booksTemp); 32 | } 33 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Sections/Poem.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | import java.util.ArrayList; 8 | 9 | public class Poem extends Section { 10 | 11 | // temps to create default sections 12 | private Book bookTemp; 13 | private ArrayList booksTemp; 14 | 15 | // constructor 16 | public Poem(Employee employee) { 17 | super("Poem", employee); 18 | 19 | buildPoemSection(); 20 | } 21 | 22 | private void buildPoemSection() { 23 | // creates default books and adds 24 | this.booksTemp = new ArrayList(); 25 | this.bookTemp = new Book("Les Fleurs du mal", "Charles Baudelaire", "1857", 24); 26 | this.booksTemp.add(this.bookTemp); 27 | this.bookTemp = new Book("Otuz Beş Yaş", "Cahit Sıtkı Tarancı", "1857", 19); 28 | this.booksTemp.add(this.bookTemp); 29 | 30 | // sends arraylist to the poem section 31 | setBooks(this.booksTemp); 32 | } 33 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/Sections/SciFi.java: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This program is written without using any IDE. 3 | Tests were completed manually by using java-9-openjdk. 4 | Please read the README.md file that is in the project. 5 | */ 6 | package bookstore; 7 | import java.util.ArrayList; 8 | 9 | public class SciFi extends Section { 10 | 11 | // temps to create default sections 12 | private Book bookTemp; 13 | private ArrayList booksTemp; 14 | 15 | // constructor 16 | public SciFi(Employee employee) { 17 | super("Sci-Fi", employee); 18 | 19 | buildSciFiSection(); 20 | } 21 | 22 | private void buildSciFiSection() { 23 | // creates default books and adds 24 | this.booksTemp = new ArrayList(); 25 | this.bookTemp = new Book("Nineteen Eighty-Four", "George Orwell", "1949", 40); 26 | this.booksTemp.add(this.bookTemp); 27 | this.bookTemp = new Book("Brave New World", "Aldous Huxley", "1932", 30); 28 | this.booksTemp.add(this.bookTemp); 29 | 30 | // sends arraylist to the sciFi section 31 | setBooks(this.booksTemp); 32 | } 33 | } -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT2-Bookstore/boratanrikulu (✔)/preview.png -------------------------------------------------------------------------------- /PT2-Bookstore/boratanrikulu (✔)/preview2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT2-Bookstore/boratanrikulu (✔)/preview2.png -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/Login.form: -------------------------------------------------------------------------------- 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 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/Login.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package p3; 7 | 8 | /** 9 | * 10 | * @author BATIN 11 | */ 12 | public class Login extends javax.swing.JFrame { 13 | 14 | String name; 15 | String pass; 16 | 17 | /** 18 | * Creates new form Login 19 | */ 20 | public Login() { 21 | initComponents(); 22 | } 23 | 24 | /** 25 | * This method is called from within the constructor to initialize the form. 26 | * WARNING: Do NOT modify this code. The content of this method is always 27 | * regenerated by the Form Editor. 28 | */ 29 | @SuppressWarnings("unchecked") 30 | // //GEN-BEGIN:initComponents 31 | private void initComponents() { 32 | 33 | label1 = new java.awt.Label(); 34 | jButton1 = new javax.swing.JButton(); 35 | label2 = new java.awt.Label(); 36 | Name = new javax.swing.JTextField(); 37 | label3 = new java.awt.Label(); 38 | Pass = new javax.swing.JPasswordField(); 39 | jButton2 = new javax.swing.JButton(); 40 | 41 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 42 | setBackground(new java.awt.Color(204, 0, 0)); 43 | 44 | label1.setBackground(new java.awt.Color(153, 102, 255)); 45 | label1.setFont(new java.awt.Font("Ubuntu Mono", 0, 18)); // NOI18N 46 | label1.setText("Login Page"); 47 | 48 | jButton1.setBackground(new java.awt.Color(51, 255, 255)); 49 | jButton1.setForeground(new java.awt.Color(0, 0, 0)); 50 | jButton1.setText("Login"); 51 | jButton1.addActionListener(new java.awt.event.ActionListener() { 52 | public void actionPerformed(java.awt.event.ActionEvent evt) { 53 | jButton1ActionPerformed(evt); 54 | } 55 | }); 56 | 57 | label2.setAlignment(java.awt.Label.CENTER); 58 | label2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); 59 | label2.setText("Name"); 60 | 61 | Name.addActionListener(new java.awt.event.ActionListener() { 62 | public void actionPerformed(java.awt.event.ActionEvent evt) { 63 | NameActionPerformed(evt); 64 | } 65 | }); 66 | 67 | label3.setAlignment(java.awt.Label.CENTER); 68 | label3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); 69 | label3.setText("Password"); 70 | 71 | Pass.addActionListener(new java.awt.event.ActionListener() { 72 | public void actionPerformed(java.awt.event.ActionEvent evt) { 73 | PassActionPerformed(evt); 74 | } 75 | }); 76 | 77 | jButton2.setText("Back "); 78 | jButton2.addActionListener(new java.awt.event.ActionListener() { 79 | public void actionPerformed(java.awt.event.ActionEvent evt) { 80 | jButton2ActionPerformed(evt); 81 | } 82 | }); 83 | 84 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 85 | getContentPane().setLayout(layout); 86 | layout.setHorizontalGroup( 87 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 88 | .addGroup(layout.createSequentialGroup() 89 | .addGap(33, 33, 33) 90 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 91 | .addComponent(jButton2) 92 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 93 | .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 94 | .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) 95 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 96 | .addGroup(layout.createSequentialGroup() 97 | .addGap(15, 15, 15) 98 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 99 | .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 100 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 101 | .addComponent(Name, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE) 102 | .addComponent(Pass, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE))) 103 | .addContainerGap(50, Short.MAX_VALUE)) 104 | .addGroup(layout.createSequentialGroup() 105 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 106 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) 107 | .addGap(33, 33, 33)))) 108 | ); 109 | layout.setVerticalGroup( 110 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 111 | .addGroup(layout.createSequentialGroup() 112 | .addGap(30, 30, 30) 113 | .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 114 | .addGap(50, 50, 50) 115 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 116 | .addComponent(Name) 117 | .addComponent(label2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 118 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 119 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 120 | .addComponent(Pass) 121 | .addComponent(label3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 122 | .addGap(18, 18, 18) 123 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 124 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) 125 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) 126 | .addGap(22, 22, 22)) 127 | ); 128 | 129 | label2.getAccessibleContext().setAccessibleName(""); 130 | 131 | pack(); 132 | }// //GEN-END:initComponents 133 | 134 | private void NameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NameActionPerformed 135 | // TODO add your handling code here: 136 | }//GEN-LAST:event_NameActionPerformed 137 | 138 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 139 | this.setVisible(false); 140 | new OpeningPage().setVisible(true); 141 | }//GEN-LAST:event_jButton2ActionPerformed 142 | 143 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 144 | name = Name.getText(); 145 | pass = Pass.getText(); 146 | if (name.equals(Register.name) && pass.equals(Register.pass)) { 147 | new LoginResult("Login Confirmed").setVisible(true); 148 | this.setVisible(false); 149 | }else{ 150 | new LoginResult("Login Failed").setVisible(true); 151 | this.setVisible(false); 152 | } 153 | 154 | }//GEN-LAST:event_jButton1ActionPerformed 155 | 156 | private void PassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PassActionPerformed 157 | // TODO add your handling code here: 158 | }//GEN-LAST:event_PassActionPerformed 159 | 160 | /** 161 | * @param args the command line arguments 162 | */ 163 | public static void main(String args[]) { 164 | /* Set the Nimbus look and feel */ 165 | // 166 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 167 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 168 | */ 169 | try { 170 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 171 | if ("Nimbus".equals(info.getName())) { 172 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 173 | break; 174 | } 175 | } 176 | } catch (ClassNotFoundException ex) { 177 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 178 | } catch (InstantiationException ex) { 179 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 180 | } catch (IllegalAccessException ex) { 181 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 182 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 183 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 184 | } 185 | // 186 | /* Create and display the form */ 187 | java.awt.EventQueue.invokeLater(() -> { 188 | new Login().setVisible(true); 189 | }); 190 | } 191 | 192 | // Variables declaration - do not modify//GEN-BEGIN:variables 193 | private javax.swing.JTextField Name; 194 | private javax.swing.JPasswordField Pass; 195 | private javax.swing.JButton jButton1; 196 | private javax.swing.JButton jButton2; 197 | private java.awt.Label label1; 198 | private java.awt.Label label2; 199 | private java.awt.Label label3; 200 | // End of variables declaration//GEN-END:variables 201 | } 202 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/LoginResult.form: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/LoginResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package p3; 7 | 8 | /** 9 | * 10 | * @author BATIN 11 | */ 12 | public class LoginResult extends javax.swing.JFrame { 13 | 14 | /** 15 | * Creates new form LoginResult 16 | * @param Result 17 | */ 18 | public LoginResult(String Result) { 19 | initComponents(); 20 | lbl.setText(Result); 21 | } 22 | 23 | private LoginResult() { 24 | initComponents(); 25 | } 26 | /** 27 | * This method is called from within the constructor to initialize the form. 28 | * WARNING: Do NOT modify this code. The content of this method is always 29 | * regenerated by the Form Editor. 30 | */ 31 | @SuppressWarnings("unchecked") 32 | // //GEN-BEGIN:initComponents 33 | private void initComponents() { 34 | 35 | lbl = new javax.swing.JLabel(); 36 | jButton2 = new javax.swing.JButton(); 37 | 38 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 39 | 40 | lbl.setFont(new java.awt.Font("Ubuntu Mono", 0, 36)); // NOI18N 41 | lbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 42 | 43 | jButton2.setText("Back "); 44 | jButton2.addActionListener(new java.awt.event.ActionListener() { 45 | public void actionPerformed(java.awt.event.ActionEvent evt) { 46 | jButton2ActionPerformed(evt); 47 | } 48 | }); 49 | 50 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 51 | getContentPane().setLayout(layout); 52 | layout.setHorizontalGroup( 53 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 54 | .addGroup(layout.createSequentialGroup() 55 | .addContainerGap() 56 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 57 | .addGroup(layout.createSequentialGroup() 58 | .addGap(12, 12, 12) 59 | .addComponent(jButton2) 60 | .addContainerGap(306, Short.MAX_VALUE)) 61 | .addGroup(layout.createSequentialGroup() 62 | .addComponent(lbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 63 | .addContainerGap()))) 64 | ); 65 | layout.setVerticalGroup( 66 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 67 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 68 | .addContainerGap(50, Short.MAX_VALUE) 69 | .addComponent(lbl, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE) 70 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 71 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) 72 | .addGap(12, 12, 12)) 73 | ); 74 | 75 | pack(); 76 | }// //GEN-END:initComponents 77 | 78 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 79 | this.setVisible(false); 80 | new OpeningPage().setVisible(true); 81 | }//GEN-LAST:event_jButton2ActionPerformed 82 | 83 | /** 84 | * @param args the command line arguments 85 | */ 86 | public static void main(String args[]) { 87 | /* Set the Nimbus look and feel */ 88 | // 89 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 90 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 91 | */ 92 | try { 93 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 94 | if ("Nimbus".equals(info.getName())) { 95 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 96 | break; 97 | } 98 | } 99 | } catch (ClassNotFoundException ex) { 100 | java.util.logging.Logger.getLogger(LoginResult.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 101 | } catch (InstantiationException ex) { 102 | java.util.logging.Logger.getLogger(LoginResult.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 103 | } catch (IllegalAccessException ex) { 104 | java.util.logging.Logger.getLogger(LoginResult.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 105 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 106 | java.util.logging.Logger.getLogger(LoginResult.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 107 | } 108 | // 109 | 110 | /* Create and display the form */ 111 | java.awt.EventQueue.invokeLater(new Runnable() { 112 | public void run() { 113 | new LoginResult().setVisible(true); 114 | } 115 | }); 116 | } 117 | 118 | // Variables declaration - do not modify//GEN-BEGIN:variables 119 | private javax.swing.JButton jButton2; 120 | private javax.swing.JLabel lbl; 121 | // End of variables declaration//GEN-END:variables 122 | } 123 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/OpeningPage.form: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/OpeningPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package p3; 7 | 8 | import java.awt.event.ActionEvent; 9 | 10 | /** 11 | * 12 | * @author BATIN 13 | */ 14 | public class OpeningPage extends javax.swing.JFrame { 15 | 16 | /** 17 | * Creates new form OpeningPage 18 | */ 19 | public OpeningPage() { 20 | initComponents(); 21 | } 22 | 23 | /** 24 | * This method is called from within the constructor to initialize the form. 25 | * WARNING: Do NOT modify this code. The content of this method is always 26 | * regenerated by the Form Editor. 27 | */ 28 | @SuppressWarnings("unchecked") 29 | // //GEN-BEGIN:initComponents 30 | private void initComponents() { 31 | 32 | label1 = new java.awt.Label(); 33 | jButton1 = new javax.swing.JButton(); 34 | jButton2 = new javax.swing.JButton(); 35 | 36 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 37 | 38 | label1.setAlignment(java.awt.Label.CENTER); 39 | label1.setBackground(new java.awt.Color(153, 102, 255)); 40 | label1.setFont(new java.awt.Font("Ubuntu Mono", 0, 24)); // NOI18N 41 | label1.setText("WELCOME"); 42 | 43 | jButton1.setText("Login"); 44 | jButton1.addActionListener(new java.awt.event.ActionListener() { 45 | public void actionPerformed(java.awt.event.ActionEvent evt) { 46 | jButton1ActionPerformed(evt); 47 | } 48 | }); 49 | 50 | jButton2.setText("Register"); 51 | jButton2.addActionListener(new java.awt.event.ActionListener() { 52 | public void actionPerformed(java.awt.event.ActionEvent evt) { 53 | jButton2ActionPerformed(evt); 54 | } 55 | }); 56 | 57 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 58 | getContentPane().setLayout(layout); 59 | layout.setHorizontalGroup( 60 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 61 | .addGroup(layout.createSequentialGroup() 62 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 63 | .addGroup(layout.createSequentialGroup() 64 | .addGap(29, 29, 29) 65 | .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE)) 66 | .addGroup(layout.createSequentialGroup() 67 | .addGap(136, 136, 136) 68 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 69 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) 70 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)))) 71 | .addGap(29, 29, 29)) 72 | ); 73 | layout.setVerticalGroup( 74 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 75 | .addGroup(layout.createSequentialGroup() 76 | .addGap(27, 27, 27) 77 | .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) 78 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 79 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) 80 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 81 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) 82 | .addContainerGap(21, Short.MAX_VALUE)) 83 | ); 84 | 85 | pack(); 86 | }// //GEN-END:initComponents 87 | 88 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 89 | 90 | Login lgn = new Login(); 91 | lgn.setVisible(true); // Main Form to show after the Login Form.. 92 | this.setVisible(false); 93 | 94 | }//GEN-LAST:event_jButton1ActionPerformed 95 | 96 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 97 | new Register().setVisible(true); 98 | this.setVisible(false); 99 | }//GEN-LAST:event_jButton2ActionPerformed 100 | 101 | /** 102 | * @param args the command line arguments 103 | */ 104 | public static void main(String args[]) { 105 | /* Set the Nimbus look and feel */ 106 | // 107 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 108 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 109 | */ 110 | try { 111 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 112 | if ("Nimbus".equals(info.getName())) { 113 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 114 | break; 115 | } 116 | } 117 | } catch (ClassNotFoundException ex) { 118 | java.util.logging.Logger.getLogger(OpeningPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 119 | } catch (InstantiationException ex) { 120 | java.util.logging.Logger.getLogger(OpeningPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 121 | } catch (IllegalAccessException ex) { 122 | java.util.logging.Logger.getLogger(OpeningPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 123 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 124 | java.util.logging.Logger.getLogger(OpeningPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 125 | } 126 | // 127 | 128 | /* Create and display the form */ 129 | java.awt.EventQueue.invokeLater(() -> { 130 | new OpeningPage().setVisible(true); 131 | 132 | }); 133 | } 134 | 135 | // Variables declaration - do not modify//GEN-BEGIN:variables 136 | private javax.swing.JButton jButton1; 137 | private javax.swing.JButton jButton2; 138 | private java.awt.Label label1; 139 | // End of variables declaration//GEN-END:variables 140 | } 141 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/Project_3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT3-LoginPage/Batın Eryılmaz (✔)/Project_3.jar -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/Register.form: -------------------------------------------------------------------------------- 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 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 |
148 | -------------------------------------------------------------------------------- /PT3-LoginPage/Batın Eryılmaz (✔)/Register.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package p3; 7 | 8 | /** 9 | * 10 | * @author BATIN 11 | */ 12 | public class Register extends javax.swing.JFrame { 13 | 14 | static String name; 15 | static String pass; 16 | 17 | 18 | public Register() { 19 | initComponents(); 20 | } 21 | 22 | /** 23 | * This method is called from within the constructor to initialize the form. 24 | * WARNING: Do NOT modify this code. The content of this method is always 25 | * regenerated by the Form Editor. 26 | */ 27 | @SuppressWarnings("unchecked") 28 | // //GEN-BEGIN:initComponents 29 | private void initComponents() { 30 | 31 | label2 = new java.awt.Label(); 32 | Name = new javax.swing.JTextField(); 33 | label3 = new java.awt.Label(); 34 | Surname = new javax.swing.JTextField(); 35 | label4 = new java.awt.Label(); 36 | Pass = new javax.swing.JPasswordField(); 37 | jButton2 = new javax.swing.JButton(); 38 | jButton3 = new javax.swing.JButton(); 39 | 40 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 41 | 42 | label2.setAlignment(java.awt.Label.CENTER); 43 | label2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); 44 | label2.setText("Name"); 45 | 46 | Name.addActionListener(new java.awt.event.ActionListener() { 47 | public void actionPerformed(java.awt.event.ActionEvent evt) { 48 | NameActionPerformed(evt); 49 | } 50 | }); 51 | 52 | label3.setAlignment(java.awt.Label.CENTER); 53 | label3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); 54 | label3.setText("Surname"); 55 | 56 | Surname.addActionListener(new java.awt.event.ActionListener() { 57 | public void actionPerformed(java.awt.event.ActionEvent evt) { 58 | SurnameActionPerformed(evt); 59 | } 60 | }); 61 | 62 | label4.setAlignment(java.awt.Label.CENTER); 63 | label4.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); 64 | label4.setText("Password"); 65 | 66 | jButton2.setBackground(new java.awt.Color(51, 255, 255)); 67 | jButton2.setForeground(new java.awt.Color(0, 0, 0)); 68 | jButton2.setText("Register"); 69 | jButton2.addActionListener(new java.awt.event.ActionListener() { 70 | public void actionPerformed(java.awt.event.ActionEvent evt) { 71 | jButton2ActionPerformed(evt); 72 | } 73 | }); 74 | 75 | jButton3.setText("Back "); 76 | jButton3.addActionListener(new java.awt.event.ActionListener() { 77 | public void actionPerformed(java.awt.event.ActionEvent evt) { 78 | jButton3ActionPerformed(evt); 79 | } 80 | }); 81 | 82 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 83 | getContentPane().setLayout(layout); 84 | layout.setHorizontalGroup( 85 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 86 | .addGroup(layout.createSequentialGroup() 87 | .addContainerGap() 88 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 89 | .addGroup(layout.createSequentialGroup() 90 | .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 91 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 92 | .addComponent(Name, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)) 93 | .addGroup(layout.createSequentialGroup() 94 | .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 95 | .addGap(20, 20, 20) 96 | .addComponent(Surname, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)) 97 | .addGroup(layout.createSequentialGroup() 98 | .addComponent(label4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 99 | .addGap(15, 15, 15) 100 | .addComponent(Pass, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE))) 101 | .addContainerGap(28, Short.MAX_VALUE)) 102 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 103 | .addGap(33, 33, 33) 104 | .addComponent(jButton3) 105 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 106 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) 107 | .addGap(19, 19, 19)) 108 | ); 109 | layout.setVerticalGroup( 110 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 111 | .addGroup(layout.createSequentialGroup() 112 | .addGap(78, 78, 78) 113 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 114 | .addComponent(Name) 115 | .addComponent(label2, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)) 116 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 117 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 118 | .addComponent(Surname) 119 | .addComponent(label3, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)) 120 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 121 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 122 | .addComponent(Pass) 123 | .addComponent(label4, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)) 124 | .addGap(58, 58, 58) 125 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 126 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) 127 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) 128 | .addGap(27, 27, 27)) 129 | ); 130 | 131 | pack(); 132 | }// //GEN-END:initComponents 133 | 134 | private void NameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NameActionPerformed 135 | // TODO add your handling code here: 136 | }//GEN-LAST:event_NameActionPerformed 137 | 138 | private void SurnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SurnameActionPerformed 139 | // TODO add your handling code here: 140 | }//GEN-LAST:event_SurnameActionPerformed 141 | 142 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 143 | name = Name.getText(); 144 | pass = Pass.getText(); 145 | this.setVisible(false); 146 | new OpeningPage().setVisible(true); 147 | }//GEN-LAST:event_jButton2ActionPerformed 148 | 149 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed 150 | this.setVisible(false); 151 | new OpeningPage().setVisible(true); 152 | }//GEN-LAST:event_jButton3ActionPerformed 153 | 154 | /** 155 | * @param args the command line arguments 156 | */ 157 | public static void main(String args[]) { 158 | /* Set the Nimbus look and feel */ 159 | // 160 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 161 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 162 | */ 163 | try { 164 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 165 | if ("Nimbus".equals(info.getName())) { 166 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 167 | break; 168 | } 169 | } 170 | } catch (ClassNotFoundException ex) { 171 | java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 172 | } catch (InstantiationException ex) { 173 | java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 174 | } catch (IllegalAccessException ex) { 175 | java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 176 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 177 | java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 178 | } 179 | // 180 | 181 | /* Create and display the form */ 182 | java.awt.EventQueue.invokeLater(() -> { 183 | new Register().setVisible(true); 184 | }); 185 | } 186 | 187 | // Variables declaration - do not modify//GEN-BEGIN:variables 188 | private javax.swing.JTextField Name; 189 | private javax.swing.JPasswordField Pass; 190 | private javax.swing.JTextField Surname; 191 | private javax.swing.JButton jButton2; 192 | private javax.swing.JButton jButton3; 193 | private java.awt.Label label2; 194 | private java.awt.Label label3; 195 | private java.awt.Label label4; 196 | // End of variables declaration//GEN-END:variables 197 | } 198 | -------------------------------------------------------------------------------- /PT3-LoginPage/README.md: -------------------------------------------------------------------------------- 1 | ## Login Page 2 | 3 | Proje fikri: [@batin](https://github.com/batin) 4 | 5 | - Projenin 4 class'tan oluşturulması tavsiye edilir. 6 | Bunlar; 7 | * **WelcomePage** 8 | * **LoginPage** 9 | * **RegisterPage** 10 | * **ResultPage** 11 | 12 | 13 | - Login Page uygulamasının aşağıdaki gibi olması istenmektedir. 14 | 15 | **WelcomePage class'ı** giriş class'ıdır. Bir hoşgeldin mesajı bulunmalıdır. Ayrıca **login** ve **register** yazılı 2 buttona sahip olmalıdır. 16 | 17 | **LoginPage class'ı** login yani giriş yapılan class'tır. Kullanıcıdan *Id* ve *Password* istenmektedir. Ayrıca bu classta *Login* ve *Back* buttonu bulunmalıdır. 18 | 19 | **RegisterPage class'ı** register yani kayıt yapılan classtır. Kullanıcıdan *Id*, *Name*, *Surname* ve *Password* istenmektedir. Ayrıca bu classta *Register* ve *Back* buttonu bulunmalıdır. 20 | 21 | **ResultPage class'ı** sonuç classıdır. Bu classta login'nin veya register'ın başarılı olup olmadığını ekrana bastırılmalıdır. 22 | 23 | **Not**: Data base kullanılmadan tek bir değişken için yapmanız yeterlidir. 24 | 25 | #### Proje son teslim tarihi: 26 | 27 | *Projenin süresi 4 gündür. **6 Mayıs (23:59)** tarihine kadar bu klasör altına **IsimSoyisim** şeklinde alt-klasör oluşturarak yüklemeniz beklenmektedir. Esinlenmenin olmaması için lütfen en erken **4 Mayıs** tarihinde yükleyiniz.* 28 | 29 | **!** Proje hakkında aklınıza takılan bir yer var ise; 30 |      Üyeler - [Soru&Cevap](https://github.com/orgs/java-util-help/teams/q-a) 31 |      Üye olmayanlar, proje üzerinde **issue** açarak sorabilirler - [Issues](https://github.com/java-util-help/projects/issues) 32 | 33 | > İsteğe bağlı olarak, hazırlamış olduğunuz proje hakkında kısa bir rapor oluşturabilirsiniz. 34 | -------------------------------------------------------------------------------- /PT3-LoginPage/boratanrikulu (✔)/MainWindow.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | package registerlogin; 6 | 7 | import java.util.ArrayList; 8 | import javax.swing.JOptionPane; 9 | 10 | class Info { 11 | private String userName; 12 | private String password; 13 | 14 | // constructor 15 | public Info(String userName, String password) { 16 | this.userName = userName; 17 | this.password = password; 18 | } 19 | 20 | // setters and getters 21 | public String getUserName() { 22 | return userName; 23 | } 24 | public void setUserName(String userName) { 25 | this.userName = userName; 26 | } 27 | public String getPassword() { 28 | return password; 29 | } 30 | public void setPassword(String password) { 31 | this.password = password; 32 | } 33 | 34 | 35 | } 36 | 37 | public class MainWindow extends javax.swing.JFrame { 38 | private static ArrayList userInfos= new ArrayList(); 39 | /** 40 | * Creates new form MainWindow 41 | */ 42 | public MainWindow() { 43 | initComponents(); 44 | } 45 | 46 | // getters and setters 47 | public static ArrayList getUserInfos() { 48 | return userInfos; 49 | } 50 | public static void setUserInfos(ArrayList userInfos) { 51 | MainWindow.userInfos = userInfos; 52 | } 53 | 54 | 55 | /** 56 | * This method is called from within the constructor to initialize the 57 | * form. WARNING: Do NOT modify this code. The content of this method is 58 | * always regenerated by the Form Editor. 59 | */ 60 | @SuppressWarnings("unchecked") 61 | // //GEN-BEGIN:initComponents 62 | private void initComponents() { 63 | 64 | RegisterLoginPanel = new javax.swing.JPanel(); 65 | login = new javax.swing.JButton(); 66 | register = new javax.swing.JButton(); 67 | LoginPanel = new javax.swing.JPanel(); 68 | userNamejlabel = new javax.swing.JLabel(); 69 | userName = new javax.swing.JTextField(); 70 | password = new javax.swing.JPasswordField(); 71 | passwordjlabel = new javax.swing.JLabel(); 72 | 73 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 74 | setBounds(new java.awt.Rectangle(350, 250, 0, 0)); 75 | 76 | RegisterLoginPanel.setBackground(new java.awt.Color(204, 0, 204)); 77 | 78 | login.setText("Login"); 79 | login.addActionListener(new java.awt.event.ActionListener() { 80 | public void actionPerformed(java.awt.event.ActionEvent evt) { 81 | loginActionPerformed(evt); 82 | } 83 | }); 84 | 85 | register.setText("Register"); 86 | register.addActionListener(new java.awt.event.ActionListener() { 87 | public void actionPerformed(java.awt.event.ActionEvent evt) { 88 | registerActionPerformed(evt); 89 | } 90 | }); 91 | 92 | javax.swing.GroupLayout RegisterLoginPanelLayout = new javax.swing.GroupLayout(RegisterLoginPanel); 93 | RegisterLoginPanel.setLayout(RegisterLoginPanelLayout); 94 | RegisterLoginPanelLayout.setHorizontalGroup( 95 | RegisterLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 96 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, RegisterLoginPanelLayout.createSequentialGroup() 97 | .addGap(76, 76, 76) 98 | .addComponent(register, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE) 99 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE) 100 | .addComponent(login, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE) 101 | .addGap(78, 78, 78)) 102 | ); 103 | RegisterLoginPanelLayout.setVerticalGroup( 104 | RegisterLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 105 | .addGroup(RegisterLoginPanelLayout.createSequentialGroup() 106 | .addGap(35, 35, 35) 107 | .addGroup(RegisterLoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 108 | .addComponent(login) 109 | .addComponent(register)) 110 | .addContainerGap(38, Short.MAX_VALUE)) 111 | ); 112 | 113 | LoginPanel.setBackground(new java.awt.Color(102, 255, 255)); 114 | 115 | userNamejlabel.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N 116 | userNamejlabel.setText("UserName"); 117 | 118 | passwordjlabel.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N 119 | passwordjlabel.setText("Password"); 120 | 121 | javax.swing.GroupLayout LoginPanelLayout = new javax.swing.GroupLayout(LoginPanel); 122 | LoginPanel.setLayout(LoginPanelLayout); 123 | LoginPanelLayout.setHorizontalGroup( 124 | LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 125 | .addGroup(LoginPanelLayout.createSequentialGroup() 126 | .addGap(120, 120, 120) 127 | .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 128 | .addComponent(passwordjlabel, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) 129 | .addComponent(userNamejlabel, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)) 130 | .addGap(90, 90, 90) 131 | .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 132 | .addComponent(userName, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) 133 | .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)) 134 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 135 | ); 136 | LoginPanelLayout.setVerticalGroup( 137 | LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 138 | .addGroup(LoginPanelLayout.createSequentialGroup() 139 | .addGap(38, 38, 38) 140 | .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 141 | .addComponent(userNamejlabel, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) 142 | .addComponent(userName)) 143 | .addGap(29, 29, 29) 144 | .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 145 | .addComponent(passwordjlabel, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) 146 | .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 147 | .addContainerGap(78, Short.MAX_VALUE)) 148 | ); 149 | 150 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 151 | getContentPane().setLayout(layout); 152 | layout.setHorizontalGroup( 153 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 154 | .addGroup(layout.createSequentialGroup() 155 | .addContainerGap() 156 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 157 | .addComponent(LoginPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 158 | .addComponent(RegisterLoginPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 159 | .addContainerGap()) 160 | ); 161 | layout.setVerticalGroup( 162 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 163 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 164 | .addContainerGap() 165 | .addComponent(LoginPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 166 | .addGap(18, 18, 18) 167 | .addComponent(RegisterLoginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 168 | .addContainerGap()) 169 | ); 170 | 171 | pack(); 172 | }// //GEN-END:initComponents 173 | 174 | private void registerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registerActionPerformed 175 | RegisterLogin registerLogin = new RegisterLogin(); 176 | 177 | registerLogin.setVisible(true); 178 | }//GEN-LAST:event_registerActionPerformed 179 | 180 | private void loginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginActionPerformed 181 | String userName = this.userName.getText(); 182 | String password = new String (this.password.getPassword()); 183 | 184 | if(this.userInfos.size() == 0 ) { 185 | JOptionPane.showMessageDialog(this, "There are not any registered users at all."); 186 | } 187 | 188 | else { 189 | for (Info userInfo : this.userInfos) { 190 | if(userInfo.getUserName().equals(userName) && userInfo.getPassword().equals(password)) { 191 | JOptionPane.showMessageDialog(this, "Welcome " + userName); 192 | return; 193 | } 194 | } 195 | 196 | JOptionPane.showMessageDialog(this, "Username or Password was wrong. Get Out!"); 197 | } 198 | }//GEN-LAST:event_loginActionPerformed 199 | 200 | /** 201 | * @param args the command line arguments 202 | */ 203 | public static void main(String args[]) { 204 | /* Set the Nimbus look and feel */ 205 | // 206 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 207 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 208 | */ 209 | try { 210 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 211 | if ("Nimbus".equals(info.getName())) { 212 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 213 | break; 214 | } 215 | } 216 | } catch (ClassNotFoundException ex) { 217 | java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 218 | } catch (InstantiationException ex) { 219 | java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 220 | } catch (IllegalAccessException ex) { 221 | java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 222 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 223 | java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 224 | } 225 | // 226 | 227 | /* Create and display the form */ 228 | java.awt.EventQueue.invokeLater(new Runnable() { 229 | public void run() { 230 | new MainWindow().setVisible(true); 231 | } 232 | }); 233 | } 234 | 235 | // Variables declaration - do not modify//GEN-BEGIN:variables 236 | private javax.swing.JPanel LoginPanel; 237 | private javax.swing.JPanel RegisterLoginPanel; 238 | private javax.swing.JButton login; 239 | private javax.swing.JPasswordField password; 240 | private javax.swing.JLabel passwordjlabel; 241 | private javax.swing.JButton register; 242 | private javax.swing.JTextField userName; 243 | private javax.swing.JLabel userNamejlabel; 244 | // End of variables declaration//GEN-END:variables 245 | } 246 | -------------------------------------------------------------------------------- /PT3-LoginPage/boratanrikulu (✔)/README.md: -------------------------------------------------------------------------------- 1 | ### Screenshot 2 | 3 |

4 | 5 |

6 | 7 | **use the following commands to use the program** 8 | 9 | ``` 10 | cd /path/to/PT3-LoginPage/boratanrikulu/ 11 | javac *.java -d . 12 | java registerlogin.MainWindow 13 | ``` -------------------------------------------------------------------------------- /PT3-LoginPage/boratanrikulu (✔)/RegisterLogin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | package registerlogin; 6 | 7 | import java.util.ArrayList; 8 | import javax.swing.JOptionPane; 9 | 10 | public class RegisterLogin extends javax.swing.JFrame { 11 | 12 | /** 13 | * Creates new form RegisterLogin 14 | */ 15 | public RegisterLogin() { 16 | initComponents(); 17 | } 18 | 19 | /** 20 | * This method is called from within the constructor to initialize the 21 | * form. WARNING: Do NOT modify this code. The content of this method is 22 | * always regenerated by the Form Editor. 23 | */ 24 | @SuppressWarnings("unchecked") 25 | // //GEN-BEGIN:initComponents 26 | private void initComponents() { 27 | 28 | jPanel1 = new javax.swing.JPanel(); 29 | jLabel1 = new javax.swing.JLabel(); 30 | jLabel2 = new javax.swing.JLabel(); 31 | userName = new javax.swing.JTextField(); 32 | register = new javax.swing.JButton(); 33 | password = new javax.swing.JPasswordField(); 34 | 35 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 36 | setBounds(new java.awt.Rectangle(400, 250, 0, 0)); 37 | 38 | jPanel1.setBackground(new java.awt.Color(204, 204, 255)); 39 | 40 | jLabel1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N 41 | jLabel1.setText("UserName"); 42 | 43 | jLabel2.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N 44 | jLabel2.setText("Password"); 45 | 46 | register.setText("Register"); 47 | register.addActionListener(new java.awt.event.ActionListener() { 48 | public void actionPerformed(java.awt.event.ActionEvent evt) { 49 | registerActionPerformed(evt); 50 | } 51 | }); 52 | 53 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 54 | jPanel1.setLayout(jPanel1Layout); 55 | jPanel1Layout.setHorizontalGroup( 56 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 57 | .addGroup(jPanel1Layout.createSequentialGroup() 58 | .addGap(69, 69, 69) 59 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 60 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 61 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 62 | .addComponent(jLabel1) 63 | .addComponent(jLabel2)) 64 | .addGap(124, 124, 124) 65 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 66 | .addComponent(userName, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE) 67 | .addComponent(password)) 68 | .addContainerGap(139, Short.MAX_VALUE)) 69 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 70 | .addComponent(register) 71 | .addGap(139, 139, 139)))) 72 | ); 73 | jPanel1Layout.setVerticalGroup( 74 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 75 | .addGroup(jPanel1Layout.createSequentialGroup() 76 | .addGap(69, 69, 69) 77 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 78 | .addComponent(jLabel1) 79 | .addComponent(userName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 80 | .addGap(40, 40, 40) 81 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 82 | .addComponent(jLabel2) 83 | .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 84 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE) 85 | .addComponent(register) 86 | .addGap(45, 45, 45)) 87 | ); 88 | 89 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 90 | getContentPane().setLayout(layout); 91 | layout.setHorizontalGroup( 92 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 93 | .addGroup(layout.createSequentialGroup() 94 | .addContainerGap() 95 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 96 | .addContainerGap()) 97 | ); 98 | layout.setVerticalGroup( 99 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 100 | .addGroup(layout.createSequentialGroup() 101 | .addContainerGap() 102 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 103 | .addContainerGap()) 104 | ); 105 | 106 | pack(); 107 | }// //GEN-END:initComponents 108 | 109 | private void registerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registerActionPerformed 110 | String userName = this.userName.getText(); 111 | String password = new String (this.password.getPassword()); 112 | 113 | if(userName.equals("") || password.equals("")) { 114 | JOptionPane.showMessageDialog(this, "Username or Password was empty."); 115 | this.setVisible(false); 116 | } 117 | else { 118 | ArrayList userInfos = MainWindow.getUserInfos(); 119 | userInfos.add(new Info(userName, password)); 120 | JOptionPane.showMessageDialog(this, "Registration was successful."); 121 | this.setVisible(false); 122 | } 123 | }//GEN-LAST:event_registerActionPerformed 124 | 125 | /** 126 | * @param args the command line arguments 127 | */ 128 | public static void main(String args[]) { 129 | /* Set the Nimbus look and feel */ 130 | // 131 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 132 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 133 | */ 134 | try { 135 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 136 | if ("Nimbus".equals(info.getName())) { 137 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 138 | break; 139 | } 140 | } 141 | } catch (ClassNotFoundException ex) { 142 | java.util.logging.Logger.getLogger(RegisterLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 143 | } catch (InstantiationException ex) { 144 | java.util.logging.Logger.getLogger(RegisterLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 145 | } catch (IllegalAccessException ex) { 146 | java.util.logging.Logger.getLogger(RegisterLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 147 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 148 | java.util.logging.Logger.getLogger(RegisterLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 149 | } 150 | // 151 | 152 | /* Create and display the form */ 153 | java.awt.EventQueue.invokeLater(new Runnable() { 154 | public void run() { 155 | new RegisterLogin().setVisible(true); 156 | } 157 | }); 158 | } 159 | 160 | // Variables declaration - do not modify//GEN-BEGIN:variables 161 | private javax.swing.JLabel jLabel1; 162 | private javax.swing.JLabel jLabel2; 163 | private javax.swing.JPanel jPanel1; 164 | private javax.swing.JPasswordField password; 165 | private javax.swing.JButton register; 166 | private javax.swing.JTextField userName; 167 | // End of variables declaration//GEN-END:variables 168 | } 169 | -------------------------------------------------------------------------------- /PT3-LoginPage/boratanrikulu (✔)/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT3-LoginPage/boratanrikulu (✔)/preview.png -------------------------------------------------------------------------------- /PT4-Cinema/README.md: -------------------------------------------------------------------------------- 1 | ## CineJAVA 2 | 3 | Proje fikri: **Pamukkale University CENG - 2017** 4 | 5 |

6 | 7 |

8 | 9 | --- 10 | 11 | Proje genel olarak sinemaya bilet almak isteyen kullanıcıların aşama aşama bilet almasını sağlamalıdır. Günümüzdeki sinema bileti alma uygulamaları gibi işlem görmelidir. 12 | 13 | Sistemde *iki tür* kullanıcı bulunmaktadır. 14 | 15 | * **Kullanıcılar:** 16 | * **Admin'ler** 17 | * **Müşteriler** 18 | 19 | **>** Her kullanıcı sisteme kullanıcı adı ve şifre ile giriş yapmalıdır. 20 | **>** Kullanıcılar sisteme üye olabilmelidir. Aynı zamanda admin tarafından da sisteme dahil edilebilirler. 21 | **>** Adminler için bir kayıt ekranı zorunluluğu yok. Opsiyonel olarak admin paneline bu özellik eklenebilir. 22 | 23 | Her grubun **rolleri aşağıdaki** gibidir: 24 | 25 | --- 26 | 27 | * **Admin:** 28 | 29 | Admin salon ekleyebilir ve salondaki sıra sayısı, her sıradaki koltuk sayısı gibi bilgilerini girebilir. 30 | *(Salon oluşturma mantığının nesneye yönelik düşünülmesi tavsiye edilmektedir)* 31 | 32 | Admin film ekleyebilir ve bu flimle ilgili *prodüksiyon yılı, oyuncular, dil, yönetmen, çıkış tarihi, 2 boyutlu - 3 boyutlu, poster vs. gibi bilgileri girebilir.* (*Fragman eklemek* **bonus** olarak sayılacaktır) 33 | 34 | Admin salonlara film ve gösterim zamanı atama işlemi yapabilir. 35 | *Satılan* ve *boş* olan koltuklar **farklı renklerde** görünmelidir. 36 | 37 | Salon, film ve gösterim zamanları **güncellenebilir** olmalıdır. 38 | 39 | --- 40 | 41 | * **Müşteri:** 42 | 43 | Kullanıcı sisteme kullanıcı adını ve şifresini kullanarak girebilir. 44 | 45 | Kullanıcı salon ve koltuk bilgilerini, **film bilgilerini** *(poster vs.)*, filmin gösterim saatlerini **görebilir**. 46 | 47 | Kullanıcı istediği gösterim saatinde istediği salondaki koltuklar için bilet satın alma işlemlerini yapabilir. *(önceden satılmamışsa)* 48 | 49 | Müşteriler almış olduğu bileti **iptal** edebilirler.**(Film gösteriminden 2 gün önceye kadar para iadesi yapılırken; Film gösterimine 2 günden az kalması takdirinde para iadesi yapılmaz.)** 50 | 51 | Kullanıcı **istediği kriterlere** göre(yönetmen, oyuncu, film adı, salon adı, gösterim saati vs.) **film arama** işlemi yapabilir. 52 | 53 | 3 boyutlu filmler için **3-D gözlük** istenip istenmediği sorulmalıdır. İsteniyorsa bilet tutarına ek olarak **3-D gözlük kiralama ücreti** eklenmelidir. 54 | 55 | Bilet satış veya rezervazyonundan sonra işleme ait tüm bilgiler ekranda listelenir.**(İşlem Özeti)** 56 | 57 | --- 58 | 59 | 60 | #### Proje son teslim tarihi: 61 | 62 | *Projenin süresi 10 gündür. **14 Haziran (23:59)** tarihine kadar bu klasör altına **IsimSoyisim** şeklinde alt-klasör oluşturarak yüklemeniz beklenmektedir. Esinlenmenin olmaması için lütfen en erken **12 Haziran** tarihinde yükleyiniz.* 63 | 64 | **!** Proje hakkında aklınıza takılan bir yer var ise; 65 |      Üyeler - [Soru&Cevap](https://github.com/orgs/java-util-help/teams/q-a) 66 |      Üye olmayanlar, proje üzerinde **issue** açarak sorabilirler - [Issues](https://github.com/java-util-help/projects/issues) 67 | 68 | > İsteğe bağlı olarak, hazırlamış olduğunuz proje hakkında kısa bir rapor oluşturabilirsiniz. 69 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Cinema. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Fri, 22 Jun 2018 17:47:19 +0300 2 | 3 | 4 | /home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu\ (not\ complete)/Cinema= 5 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/logo.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/screen.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/selected-seat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/selected-seat.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/taken-seat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/taken-seat.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/vacant-seat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/build/classes/cinema/vacant-seat.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/dist/Cinema.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/dist/Cinema.jar -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "Cinema.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, these files (folders) 25 | are not copied. 26 | * If a library on the projects classpath also has a Class-Path element 27 | specified in the manifest,the content of the Class-Path element has to be on 28 | the projects runtime path. 29 | * To set a main class in a standard Java project, right-click the project node 30 | in the Projects window and choose Properties. Then click Run and enter the 31 | class name in the Main Class field. Alternatively, you can manually type the 32 | class name in the manifest Main-Class element. 33 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/dist/lib/jsoup-1.11.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/dist/lib/jsoup-1.11.3.jar -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/dist/lib/mariadb-java-client-2.2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/dist/lib/mariadb-java-client-2.2.5.jar -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=7bd2183c 2 | build.xml.script.CRC32=c5c7cec3 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=7bd2183c 7 | nbproject/build-impl.xml.script.CRC32=1b7dda97 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=/home/fsutil/.netbeans/8.2/build.properties 3 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu%20(not%20complete)/Cinema/src/cinema/Frames/BuyTickets.java 7 | file:/home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu%20(not%20complete)/Cinema/src/cinema/Objects/Movie.java 8 | file:/home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu%20(not%20complete)/Cinema/src/cinema/Frames/ShowSeats.java 9 | file:/home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu%20(not%20complete)/Cinema/src/cinema/Frames/ShowMovies.java 10 | file:/home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu%20(not%20complete)/Cinema/src/cinema/DatabaseProcesses/Scrape/UpdateDB.java 11 | file:/home/fsutil/Documents/programming/JAVA/java.util.help/projects/PT4-Cinema/boratanrikulu%20(not%20complete)/Cinema/src/cinema/DatabaseProcesses/Scrape/IMDb_Scraper.java 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.test.classpath=\ 22 | ${run.test.classpath} 23 | # Files in build.classes.dir which should be excluded from distribution jar 24 | dist.archive.excludes= 25 | # This directory is removed when the project is cleaned: 26 | dist.dir=dist 27 | dist.jar=${dist.dir}/Cinema.jar 28 | dist.javadoc.dir=${dist.dir}/javadoc 29 | excludes= 30 | file.reference.jsoup-1.11.3.jar=/home/fsutil/Documents/programming/JAVA/driver/jsoup-1.11.3.jar 31 | file.reference.mariadb-java-client-2.2.5.jar=/home/fsutil/Documents/programming/JAVA/driver/mariadb-java-client-2.2.5.jar 32 | includes=** 33 | jar.compress=false 34 | javac.classpath=\ 35 | ${file.reference.mariadb-java-client-2.2.5.jar}:\ 36 | ${file.reference.jsoup-1.11.3.jar} 37 | # Space-separated list of extra javac options 38 | javac.compilerargs= 39 | javac.deprecation=false 40 | javac.external.vm=true 41 | javac.processorpath=\ 42 | ${javac.classpath} 43 | javac.source=1.8 44 | javac.target=1.8 45 | javac.test.classpath=\ 46 | ${javac.classpath}:\ 47 | ${build.classes.dir} 48 | javac.test.processorpath=\ 49 | ${javac.test.classpath} 50 | javadoc.additionalparam= 51 | javadoc.author=false 52 | javadoc.encoding=${source.encoding} 53 | javadoc.noindex=false 54 | javadoc.nonavbar=false 55 | javadoc.notree=false 56 | javadoc.private=false 57 | javadoc.splitindex=true 58 | javadoc.use=true 59 | javadoc.version=false 60 | javadoc.windowtitle= 61 | main.class=cinema.Frames.SignIn 62 | manifest.file=manifest.mf 63 | meta.inf.dir=${src.dir}/META-INF 64 | mkdist.disabled=false 65 | platform.active=default_platform 66 | run.classpath=\ 67 | ${javac.classpath}:\ 68 | ${build.classes.dir} 69 | # Space-separated list of JVM arguments used when running the project. 70 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 71 | # To set system properties for unit tests define test-sys-prop.name=value: 72 | run.jvmargs= 73 | run.test.classpath=\ 74 | ${javac.test.classpath}:\ 75 | ${build.test.classes.dir} 76 | source.encoding=UTF-8 77 | src.dir=src 78 | test.src.dir=test 79 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Cinema 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/DatabaseProcesses/DatabaseConnector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.DatabaseProcesses; 7 | 8 | import java.sql.Connection; 9 | import java.sql.DriverManager; 10 | import java.sql.SQLException; 11 | 12 | public class DatabaseConnector { 13 | 14 | public Connection connection = null; 15 | 16 | /* constructor */ 17 | public DatabaseConnector() { 18 | String url = "jdbc:mysql://" + DatabaseInfo.getHost() + ":" + DatabaseInfo.getPort() + "/" + DatabaseInfo.getName() + "?useUnicode=true&characterEncoding=utf8"; 19 | 20 | try { // loads driver 21 | Class.forName("org.mariadb.jdbc.Driver"); 22 | System.out.println("Driver is loaded."); 23 | } catch (ClassNotFoundException ex) { 24 | System.out.println("Driver is not found."); 25 | } 26 | 27 | try { // makes connection 28 | connection = DriverManager.getConnection(url, DatabaseInfo.getUsername(), DatabaseInfo.getPassword()); 29 | System.out.println("Connection is successful."); 30 | } catch (SQLException ex) { 31 | System.out.println("Connection is failed."); 32 | } 33 | } 34 | 35 | /* getter */ 36 | public Connection getConnection() { 37 | return this.connection; 38 | } 39 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/DatabaseProcesses/DatabaseInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.DatabaseProcesses; 7 | 8 | public class DatabaseInfo { 9 | 10 | private static final String username = "root"; 11 | private static final String password = "password"; 12 | private static final String name = "cinema"; 13 | private static final String host = "localhost"; 14 | private static final int port = 3306; 15 | 16 | /* getters */ 17 | public static String getUsername() { 18 | return username; 19 | } 20 | public static String getPassword() { 21 | return password; 22 | } 23 | public static String getName() { 24 | return name; 25 | } 26 | public static String getHost() { 27 | return host; 28 | } 29 | public static int getPort() { 30 | return port; 31 | } 32 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/DatabaseProcesses/Scrape/IMDb_Scraper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.DatabaseProcesses.Scrape; 7 | 8 | import cinema.Objects.Movie; 9 | import java.io.IOException; 10 | import java.time.LocalDate; 11 | import java.time.format.DateTimeFormatter; 12 | import java.util.ArrayList; 13 | import java.util.logging.Level; 14 | import java.util.logging.Logger; 15 | import org.jsoup.nodes.Document; 16 | import org.jsoup.Jsoup; 17 | import org.jsoup.nodes.Element; 18 | import org.jsoup.select.Elements; 19 | 20 | public class IMDb_Scraper { 21 | 22 | private Document document; 23 | private Movie movie; 24 | private ArrayList movies; 25 | private String title; 26 | private String genre; 27 | private String duration; 28 | private double rating; 29 | private String director; 30 | private String actors; 31 | private String date; 32 | private String urlPoster; 33 | private String summary; 34 | private String[] fourDays; 35 | 36 | public IMDb_Scraper() { 37 | try { 38 | document = Jsoup.connect("https://www.imdb.com/movies-in-theaters/").get(); 39 | this.movies = new ArrayList(); 40 | setFourDays(); 41 | scrape(); 42 | } catch (IOException ex) { 43 | Logger.getLogger(IMDb_Scraper.class.getName()).log(Level.SEVERE, null, ex); 44 | } 45 | } 46 | 47 | /* setter */ 48 | public void setMovie() { 49 | movie = new Movie(title, genre, duration, rating, director, actors, date, urlPoster, summary); 50 | 51 | movies.add(movie); 52 | } 53 | 54 | /* getter */ 55 | public ArrayList getMovies() { 56 | return movies; 57 | } 58 | 59 | public void scrape() { 60 | clearMovies(); 61 | Elements rows = document.select("div.list.detail.sub-list"); 62 | 63 | for(Element element : rows) { // takes the top ten list from the In Theaters page 64 | if(element.select("h3").text().equals("In Theaters Now - Box Office Top Ten")){ 65 | rows = element.select("div.list_item"); 66 | } 67 | } 68 | 69 | for(String date : fourDays) { 70 | for (Element row : rows) { // scrapes informations, creates movie objects, add the objects to an array list 71 | setTitle(row); 72 | setGenre(row); 73 | setDuration(row); 74 | setRating(row); 75 | setDirector(row); 76 | setActors(row); 77 | setDate(date); 78 | setUrlPoster(row); 79 | setSummary(row); 80 | 81 | setMovie(); 82 | } 83 | } 84 | } 85 | 86 | /* scrape methods */ 87 | private void setTitle(Element row) { 88 | title = row.select("h4").text(); 89 | } 90 | 91 | private void setGenre(Element row) { 92 | Elements genres = row.select("p.cert-runtime-genre span[itemprop = genre]"); 93 | if(genres.size() >= 2) 94 | genre = genres.get(0).text() + ", " + genres.get(1).text(); 95 | else if(genres.size() == 1) 96 | genre = genres.get(0).text(); 97 | else 98 | genre = ""; 99 | } 100 | 101 | private void setDuration(Element row) { 102 | duration = row.select("p.cert-runtime-genre time[itemprop = duration]").text(); 103 | } 104 | 105 | private void setRating(Element row) { 106 | rating = Double.valueOf(row.select("div.rating_txt span.value").text()); 107 | } 108 | 109 | private void setDirector(Element row) { 110 | this.director = row.select("div.txt-block span[itemprop = director]").text(); 111 | } 112 | 113 | private void setActors(Element row) { 114 | Elements actors = row.select("div.txt-block span[itemprop = actors]"); 115 | if(actors.size() >= 3) 116 | this.actors = actors.get(0).text() + ", " + actors.get(1).text() + ", " + actors.get(2).text(); 117 | else if(actors.size() == 2) 118 | this.actors = actors.get(0).text() + ", " + actors.get(1).text(); 119 | else if(actors.size() == 1) 120 | this.actors = actors.get(0).text(); 121 | else 122 | this.actors = ""; 123 | } 124 | 125 | private void setUrlPoster(Element row) { 126 | urlPoster = row.select("img.poster.shadowed").attr("src"); 127 | } 128 | 129 | private void setDate(String date) { 130 | this.date = date.format(date); 131 | } 132 | 133 | private void setSummary(Element row) { 134 | summary = row.select("div.outline").text(); 135 | } 136 | 137 | private void setFourDays() { 138 | fourDays = new String[4]; 139 | 140 | DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyy-MM-dd"); 141 | LocalDate localDate = LocalDate.now(); 142 | 143 | localDate = LocalDate.of(localDate.getYear(), localDate.getMonth(), localDate.getDayOfMonth()); 144 | fourDays[0] = date.format(localDate); 145 | 146 | localDate = LocalDate.of(localDate.getYear(), localDate.getMonth(), localDate.getDayOfMonth()+1); 147 | fourDays[1] = date.format(localDate); 148 | 149 | localDate = LocalDate.of(localDate.getYear(), localDate.getMonth(), localDate.getDayOfMonth()+1); 150 | fourDays[2] = date.format(localDate); 151 | 152 | localDate = LocalDate.of(localDate.getYear(), localDate.getMonth(), localDate.getDayOfMonth()+1); 153 | fourDays[3] = date.format(localDate); 154 | } 155 | 156 | public void clearMovies() { 157 | if(!movies.isEmpty()) 158 | movies.clear(); 159 | } 160 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/DatabaseProcesses/Scrape/UpdateDB.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.DatabaseProcesses.Scrape; 7 | 8 | import cinema.DatabaseProcesses.DatabaseConnector; 9 | import cinema.Objects.Movie; 10 | import java.sql.Connection; 11 | import java.sql.PreparedStatement; 12 | import java.sql.SQLException; 13 | import java.util.ArrayList; 14 | import java.util.logging.Level; 15 | import java.util.logging.Logger; 16 | 17 | public class UpdateDB { 18 | 19 | private Connection connection; 20 | private ArrayList movies; 21 | private PreparedStatement preparedStatement; 22 | 23 | public UpdateDB(/*Connection connection*/) { 24 | this.connection = new DatabaseConnector().getConnection(); 25 | this.movies = new IMDb_Scraper().getMovies(); 26 | } 27 | 28 | public static void main(String[] args) { 29 | UpdateDB updateDB = new UpdateDB(/*connection*/); 30 | updateDB.updateDataBase(); 31 | } 32 | 33 | public void updateDataBase() { 34 | String query = "INSERT INTO movies(title, genre, duration, rating, director, actors, date, time, urlPoster, summary)" 35 | + "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ; 36 | 37 | for(Movie movie : movies) { 38 | String[] times = {"10:00", "13:00", "16:00", "21:00"}; 39 | for(String time : times) { 40 | try { 41 | preparedStatement = connection.prepareStatement(query); 42 | 43 | preparedStatement.setString(1, movie.getTitle()); 44 | preparedStatement.setString(2, movie.getGenre()); 45 | preparedStatement.setString(3, movie.getDuration()); 46 | preparedStatement.setDouble(4, movie.getRating()); 47 | preparedStatement.setString(5, movie.getDirector()); 48 | preparedStatement.setString(6, movie.getActors()); 49 | preparedStatement.setString(7, movie.getDate()); 50 | preparedStatement.setString(8, time); 51 | preparedStatement.setString(9, movie.getUrlPoster()); 52 | preparedStatement.setString(10, movie.getSummary()); 53 | 54 | preparedStatement.executeUpdate(); 55 | } catch (SQLException ex) { 56 | Logger.getLogger(UpdateDB.class.getName()).log(Level.SEVERE, null, ex); 57 | } 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/Frames/SignIn.form: -------------------------------------------------------------------------------- 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 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/Objects/Customer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.Objects; 7 | 8 | public class Customer { 9 | 10 | private String name; 11 | private String surname; 12 | private String email; 13 | private String password; 14 | private String birthdate; 15 | private String address; 16 | 17 | /* constructor */ 18 | public Customer(String name, String surname, String email, String password, String birthdate) { 19 | this.name = name; 20 | this.surname = surname; 21 | this.email = email; 22 | this.password = password; 23 | this.birthdate = birthdate; 24 | } 25 | 26 | /* getters */ 27 | public String getName() { 28 | return name; 29 | } 30 | public String getSurname() { 31 | return surname; 32 | } 33 | public String getEmail() { 34 | return email; 35 | } 36 | public String getPassword() { 37 | return password; 38 | } 39 | public String getBirthdate() { 40 | return birthdate; 41 | } 42 | public String getAddress() { 43 | return address; 44 | } 45 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/Objects/Movie.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.Objects; 7 | 8 | public class Movie { 9 | 10 | private int id; 11 | private String title; 12 | private String genre; 13 | private String duration; 14 | private double rating; 15 | private String director; 16 | private String actors; 17 | private String date; 18 | private String time; 19 | private String urlPoster; 20 | private String summary; 21 | 22 | /* constructors */ 23 | public Movie(int id, String title, String genre, String duration, double rating, String director, String actors, String date, String time, String urlPoster, String summary) { 24 | this.id = id; 25 | this.title = title; 26 | this.genre = genre; 27 | this.duration = duration; 28 | this.rating = rating; 29 | this.director = director; 30 | this.actors = actors; 31 | this.date = date; 32 | this.time = time; 33 | this.urlPoster = urlPoster; 34 | this.summary = summary; 35 | } 36 | public Movie(String title, String genre, String duration, double rating, String director, String actors, String date, String urlPoster, String summary) { 37 | this.title = title; 38 | this.genre = genre; 39 | this.duration = duration; 40 | this.rating = rating; 41 | this.director = director; 42 | this.actors = actors; 43 | this.date = date; 44 | this.urlPoster = urlPoster; 45 | this.summary = summary; 46 | } 47 | 48 | /* getters */ 49 | public int getID() { 50 | return id; 51 | } 52 | public String getTitle() { 53 | return title; 54 | } 55 | public String getGenre() { 56 | return genre; 57 | } 58 | public String getDuration() { 59 | return duration; 60 | } 61 | public double getRating() { 62 | return rating; 63 | } 64 | public String getDirector() { 65 | return director; 66 | } 67 | public String getActors() { 68 | return actors; 69 | } 70 | public String getDate() { 71 | return date; 72 | } 73 | public String getTime() { 74 | return time; 75 | } 76 | public String getUrlPoster() { 77 | return urlPoster; 78 | } 79 | public String getSummary() { 80 | return summary; 81 | } 82 | 83 | /* toString */ 84 | public String toString() { 85 | return getTitle() + getGenre() + getRating() + getDirector() + getActors(); 86 | } 87 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/Objects/Seat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.Objects; 7 | 8 | public class Seat { 9 | 10 | private enum Status { 11 | VACANT(), 12 | TAKEN(), 13 | SELECTED(); 14 | } 15 | private Status status; 16 | private int number; 17 | 18 | /* constructor */ 19 | public Seat(int number) { 20 | this.status = Status.VACANT; 21 | this.number = number; 22 | } 23 | 24 | /* isIts */ 25 | public boolean isVacant() { 26 | return status.equals(Status.VACANT); 27 | } 28 | public boolean isTaken() { 29 | return status.equals(Status.TAKEN); 30 | } 31 | public boolean isSelected() { 32 | return status.equals(Status.SELECTED); 33 | } 34 | 35 | /* setters */ 36 | public void setStatusVacant() { 37 | this.status = Status.VACANT; 38 | } 39 | public void setStatusTaken() { 40 | this.status = Status.TAKEN; 41 | } 42 | public void setStatusSeleted() { 43 | this.status = Status.SELECTED; 44 | } 45 | 46 | /* getter */ 47 | public int getNumber() { 48 | return number; 49 | } 50 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/Objects/Theatre.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author boratanrikulu 3 | * If you have any question about the project, you can contact me at http://boratanrikulu.me/contact 4 | */ 5 | 6 | package cinema.Objects; 7 | 8 | public class Theatre { 9 | 10 | private int seatNumber; 11 | private Seat[] seats; 12 | 13 | /* constructor */ 14 | public Theatre(int seatNumber) { 15 | this.seatNumber = seatNumber; 16 | setSeats(); 17 | } 18 | 19 | /* setter */ 20 | public void setSeats() { 21 | seats = new Seat[seatNumber]; 22 | for(int counter = 0; counter < seatNumber; counter++) { 23 | seats[counter] = new Seat(counter); 24 | } 25 | } 26 | 27 | /* getter */ 28 | public Seat[] getSeats() { 29 | return seats; 30 | } 31 | public Seat getSeat(int counter) { 32 | return seats[counter]; 33 | } 34 | } -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/logo.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/screen.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/selected-seat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/selected-seat.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/taken-seat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/taken-seat.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/vacant-seat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/Cinema/src/cinema/vacant-seat.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/JAR/Cinema.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/JAR/Cinema.jar -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/JAR/lib/jsoup-1.11.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/JAR/lib/jsoup-1.11.3.jar -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/JAR/lib/mariadb-java-client-2.2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/JAR/lib/mariadb-java-client-2.2.5.jar -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/README.md: -------------------------------------------------------------------------------- 1 | ### Usage Example 2 | 3 | Note: This Project is not completed yet. 4 | Note2: All movies is automatically scraped from IMDb. To see scraper check [Cinema/src/cinema/DatabaseProcesses/Scrape/](Cinema/src/cinema/DatabaseProcesses/Scrape/) 5 | 6 |

7 | 8 |

9 |

10 | 11 |

12 |

13 | 14 |

15 |

16 | 17 |

18 | -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/img/1.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/img/2.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/img/3.png -------------------------------------------------------------------------------- /PT4-Cinema/boratanrikulu (✔)/img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/boratanrikulu (✔)/img/4.png -------------------------------------------------------------------------------- /PT4-Cinema/img/javaUtilHelp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/java-util-help/projects/0194f6c905b9d47ba6e2d40775d6f805afe9fca5/PT4-Cinema/img/javaUtilHelp.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Aktif Proje 2 | 3 | - NULL 4 | 5 | ## Tamamlanan Projeler 6 | 7 | - Proje 4 : [Cinema](PT4-Cinema) 8 | - Proje 3 : [Login Page](PT3-LoginPage) 9 | - Proje 2 : [Bookstore](PT2-Bookstore) 10 | - Proje 1 : [Hotel](PT1-Hotel) 11 | 12 | ## Projelerin Amacı 13 | 14 | - Bir dili sadece okulda yapılanlar üzerinden öğrenmek maalesef *mümkün değil*. Biz de bu sebepten dolayı, kendi aramızda projeler belirleyip bunları yazmaya karar verdik. 15 | 16 | Yazdığımız projeler sayesinde, bir yandan Java'yı ve Nesneye Yönelik Programlama yetimizi geliştirmeye çalışken bir yandan da bir ekip olarak GitHub üzerinde nasıl çalışır öğreniyoruz. 17 | 18 | Eğer sen de bizimle birlikte kendini geliştirmek ve proje yazmak istiyorsan bilgilendirme amaçlı açtığımız sayfaya göz atmalısın. [Bilgilendirme Sayfası](https://github.com/java-util-help/info/blob/master/README.md) 19 | --------------------------------------------------------------------------------