Package main
Interface ICustomerBetService
- All Known Implementing Classes:
BetOrganization
Interface for customer betting services, defining methods for calculating gains and presenting
results, as well as a default method for saving results to a text file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalculates and updates the gains for each customer based on their bets and the actual game outcomes.default voidSaves the provided betting results to a default text file named "bet-results.txt".voidDisplays the betting results of each customer to the console and saves these results to a text file for record-keeping.
-
Method Details
-
calculateGainsPerCustomer
void calculateGainsPerCustomer()Calculates and updates the gains for each customer based on their bets and the actual game outcomes. Each customer’s total gains are updated if they win their bets. -
showCustomersResults
void showCustomersResults()Displays the betting results of each customer to the console and saves these results to a text file for record-keeping. -
printCustomersResultsToTextFile
Saves the provided betting results to a default text file named "bet-results.txt".This method writes the betting results to a text file, ensuring that all customer results are persistently stored. In case of an error during the file-writing process, an error message is displayed.
- Parameters:
output- The string containing results data to be saved to the file.
-