Practice tasks on one-dimensional and two-dimensional arrays in Java.
📘 Практические задания по теме "Массивы и двумерные массивы" в Java. Выполнено в рамках обучения на платформе Skillbox.
📄 File: practice/reverseArray/ReverseArray.java
📌 Method reverse(String[] array) reverses the array in-place.
📎 Example:
Input: ["a", "b", "c", "d"]
Output: ["d", "c", "b", "a"]
📄 File: practice/hospital/Hospital.java
📌 Two methods:
- generatePatientsTemperatures() generates random body temperatures from 32.0°C to 40.0°C
- getReport() returns a report with:
- All temperatures
- Average temperature
- Count of healthy patients (36.2°C to 36.9°C)
📄 File: practice/twoDimensionalArray/TwoDimensionalArray.java
📌 Method getTwoDimensionalArray(int size) creates a square char matrix:
- 'X' on both diagonals
- ' ' (space) elsewhere
📎 Example (7×7): X X X X X X X X X X X X X
- Install Java (JDK 17+)
- Open the project in IntelliJ IDEA
- Run the desired file from src/main/java/practice/...
- Java 17
- IntelliJ IDEA
- Arrays, Math.random(), loops
- JUnit (если есть тесты)
java_arrays/ ├── src/ │ └── main/ │ └── java/ │ └── practice/ │ ├── reverseArray/ │ │ └── ReverseArray.java │ ├── hospital/ │ │ └── Hospital.java │ └── twoDimensionalArray/ │ └── TwoDimensionalArray.java └── README.md
Маргарита Арюткина