Skip to content

margarita-java/java_collectionsarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Java Arrays Practice

Practice tasks on one-dimensional and two-dimensional arrays in Java.
📘 Практические задания по теме "Массивы и двумерные массивы" в Java. Выполнено в рамках обучения на платформе Skillbox.


🧩 Tasks / Задания

1. 🔁 Reverse Array / Переворот массива

📄 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"]


2. 🌡️ Hospital Temperatures / Температуры пациентов

📄 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)

3. ❌ X-pattern Matrix / Матрица с диагоналями X

📄 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


🚀 How to Run / Как запустить

  1. Install Java (JDK 17+)
  2. Open the project in IntelliJ IDEA
  3. Run the desired file from src/main/java/practice/...

🛠️ Technologies / Технологии

  • Java 17
  • IntelliJ IDEA
  • Arrays, Math.random(), loops
  • JUnit (если есть тесты)

📁 Project Structure / Структура проекта

java_arrays/ ├── src/ │ └── main/ │ └── java/ │ └── practice/ │ ├── reverseArray/ │ │ └── ReverseArray.java │ ├── hospital/ │ │ └── Hospital.java │ └── twoDimensionalArray/ │ └── TwoDimensionalArray.java └── README.md


👩‍💻 Author / Автор

Маргарита Арюткина

About

Practice tasks on one-dimensional and two-dimensional arrays in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages