A Gatica le gusta jugar mucho boliche, se propuso ir una semana a jugar. Decidió jugar dos líneas por día e irá anotando su puntuación total de cada día. Al finalizar la semana Gatica tuvo la curiosidad de ver su promedio semanal y también de conocer cuál fue su mayor puntaje en la semana. Ayúdalo a obtener su promedio y su mayor puntaje.
float total_points; int total_games; int highscore; int calculate_average(int total_points, int total_games) { return total_points / total_games; } int get_highscore(int highscore, int new_score) { if(new_score > highscore) { highscore = new_score; } return highscore; } void play_bowling() { total_games = total_games + 2; int score = get_score(); total_points = total_points + score; highscore = get_highscore(highscore, score); } void main() { total_games = 0; total_points = 0; highscore = 0; for(int i = 0; i < 7; i++) { play_bowling(); } float average = calculate_average(total_points, total_games); cout << "El promedio de Gatica es de " << average << "