/JavaChallenges

A compilation of programming challenges using Java.

Primary LanguageJava

Challenge 1: Temperature Matrix

In this challenge, you'll develop an algorithm to calculate the average temperatures across different cities over the span of a week, using a matrix. The matrix will store the daily temperatures of five cities across seven days.

Requirements:

  • Use a 5x7 matrix, where rows represent the cities, and columns represent the days.
  • The algorithm must:
    • Prompt the user to input the temperature for each city, for each day.
    • Calculate and display the weekly average temperature for each city.
    • Calculate and display the overall average temperature of all cities for the week.
    • Identify and display the city with the highest average temperature.

What improve?

This exercise will help you deepen your understanding of navigating through matrices, summing values in specific rows or columns, and calculating averages. It’s an excellent next step after working with simple sums of vectors and matrices.