diff --git a/G3_CENG211_HW1/src/Query.java b/G3_CENG211_HW1/src/Query.java index cf75008..be5b46c 100644 --- a/G3_CENG211_HW1/src/Query.java +++ b/G3_CENG211_HW1/src/Query.java @@ -1,4 +1,39 @@ public class Query { - //sorgulama + + public void findTheSectionWithTheHighestRevenue(Venue venue){ + Section[] sections = venue.getSections(); + double highestRevenue = 0; + int highestRevenueID = 0; + + for(int i = 0; i < sections.length; i++){ + if (sections[i].calculateRevenue()>highestRevenue){ + highestRevenue = sections[i].calculateRevenue(); + highestRevenueID = i+1; + } + } + + System.out.println("Section with the highest revenue is section " + highestRevenueID + + ", and the revenue of this section is " + highestRevenue); + } + + public void findTheTotalRevenueOfTheVenue(Venue venue){ + + } + + public void findTheOccupancyRateOfTheVenue(Venue venue){ + + } + + public void findTheHighetsPaidCustomersTickets(Venue venue){ + + } + + public void findTheMostExpensiveTicket(Venue venue){ + + } + + private void drawTheSection(Venue venue){ + + } } diff --git a/G3_CENG211_HW1/src/TicketBookingApplication.java b/G3_CENG211_HW1/src/TicketBookingApplication.java index e319928..c26d42c 100644 --- a/G3_CENG211_HW1/src/TicketBookingApplication.java +++ b/G3_CENG211_HW1/src/TicketBookingApplication.java @@ -16,7 +16,10 @@ public static void main(String[] args) throws Exception { throw exception; // Re-throw the exception to be handled in the main method } catch (IOException e) { System.out.println("An error occurred: " + e.getMessage()); + throw e; // Ensure IOException is also re-thrown for handling in main method + + } } diff --git a/G3_CENG211_HW1/src/Venue.java b/G3_CENG211_HW1/src/Venue.java index e43ba4b..e353f71 100644 --- a/G3_CENG211_HW1/src/Venue.java +++ b/G3_CENG211_HW1/src/Venue.java @@ -1,6 +1,6 @@ public class Venue { private int numOfSections; - private Section[] sections; + private Section[] sections; //0,1,2,3 // Constructors