Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion G3_CENG211_HW1/src/Query.java
Original file line number Diff line number Diff line change
@@ -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){

}

}
3 changes: 3 additions & 0 deletions G3_CENG211_HW1/src/TicketBookingApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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


}

}
Expand Down
2 changes: 1 addition & 1 deletion G3_CENG211_HW1/src/Venue.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public class Venue {
private int numOfSections;
private Section[] sections;
private Section[] sections; //0,1,2,3

// Constructors

Expand Down