Skip to content

Commit 583bb22

Browse files
Merge branch 'main' into feuters/lab1
2 parents ffbbad7 + 03cb16f commit 583bb22

File tree

1,844 files changed

+47044
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,844 files changed

+47044
-261
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# http://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
# Change these settings to your own preference
10+
indent_style = space
11+
indent_size = 4
12+
13+
# We recommend you to keep these unchanged
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

SECURITY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Use this section to tell people about which versions of your project are
6+
currently being supported with security updates.
7+
8+
| Version | Supported |
9+
| ------- | ------------------ |
10+
| < 4.0 | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
Use this section to tell people how to report a vulnerability.
15+
16+
Tell them where to go, how often they can expect to get an update on a
17+
reported vulnerability, what to expect if the vulnerability is accepted or
18+
declined, etc.

pom.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>ru.mirea.practice</groupId>
@@ -13,8 +13,8 @@
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<maven.compiler.source>11</maven.compiler.source>
1515
<maven.compiler.target>11</maven.compiler.target>
16-
<version.junit>1.11.1</version.junit>
17-
<version.jupiter>5.11.1</version.jupiter>
16+
<version.junit>1.11.2</version.junit>
17+
<version.jupiter>5.11.2</version.jupiter>
1818
<version.pmd>6.52.0</version.pmd>
1919
</properties>
2020

@@ -27,6 +27,7 @@
2727
</scm>
2828

2929
<modules>
30+
<module>students/23K0623</module>
3031
<module>students/0000001</module>
3132
<module>students/23K0093</module>
3233
<module>students/23K0690</module>
@@ -44,6 +45,7 @@
4445
<module>students/23K0364</module>
4546
<module>students/23K0155</module>
4647
<module>students/23K0114</module>
48+
<module>students/23K0815</module>
4749
<module>students/23K0341</module>
4850
<module>students/23K0823</module>
4951
<module>students/23K0087</module>
@@ -54,7 +56,6 @@
5456
<module>students/23K0116</module>
5557
<module>students/23K0339</module>
5658
<module>students/23K0691</module>
57-
<module>students/23K0815</module>
5859
<module>students/23K0089</module>
5960
<module>students/23K0375</module>
6061
<module>students/23K0340</module>
@@ -68,9 +69,18 @@
6869
<module>students/23K0130</module>
6970
<module>students/23K0164</module>
7071
<module>students/23K0140</module>
72+
<module>students/23K0505</module>
7173
<module>students/23K0359</module>
7274
<module>students/23K0688</module>
7375
<module>students/23K0355</module>
76+
<module>students/23K0215</module>
77+
<module>students/23K1167</module>
78+
<module>students/23K1226</module>
79+
<module>students/23K9901</module>
80+
<module>students/23K0145</module>
81+
<module>students/23K0186</module>
82+
<module>students/23K0755</module>
83+
<module>students/23K0362</module>
7484
</modules>
7585
<dependencies>
7686
<dependency>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<artifactId>23F0011</artifactId>
7+
<groupId>ru.mirea.practice</groupId>
8+
<version>2024.1</version>
9+
<relativePath>../pom.xml</relativePath>
10+
</parent>
11+
<artifactId>23F0011-p04_1</artifactId>
12+
<description>Массивы</description>
13+
</project>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package ru.mirea.practice.s23f0011;
2+
3+
public class Task2 {
4+
private final String number;
5+
private final String model;
6+
private final double weight;
7+
8+
public Task2(String number, String model, double weight) {
9+
this.number = number;
10+
this.model = model;
11+
this.weight = weight;
12+
}
13+
14+
// Конструктор с двумя параметрами
15+
public Task2(String number, String model) {
16+
this(number, model, 0.0);
17+
}
18+
19+
public Task2() {
20+
this("", "");
21+
}
22+
23+
public static void main(String[] args) {
24+
Task2 phone1 = new Task2("123-456-7890", "iPhone 13", 200.0);
25+
Task2 phone2 = new Task2("987-654-3210", "Samsung Galaxy S22");
26+
phone1.printInfo();
27+
System.out.println();
28+
phone2.printInfo();
29+
System.out.println();
30+
Task2 phone3 = new Task2();
31+
phone3.printInfo();
32+
System.out.println();
33+
34+
phone1.receiveCall("Роман");
35+
System.out.println("Номер: " + phone1.getNumber());
36+
System.out.println();
37+
phone2.receiveCall("Аня", "111-222-3333");
38+
System.out.println("Номер: " + phone2.getNumber());
39+
System.out.println();
40+
41+
phone3.sendMessage("123-456-7890", "987-654-3210", "111-222-3333");
42+
}
43+
44+
public void receiveCall(String name) {
45+
System.out.println("Звонит " + name);
46+
}
47+
48+
public void receiveCall(String name, String phoneNumber) {
49+
System.out.println("Звонит " + name + " с номера " + phoneNumber);
50+
}
51+
52+
public String getNumber() {
53+
return number;
54+
}
55+
56+
public void sendMessage(String... numbers) {
57+
System.out.println("Отправка сообщения на номера:");
58+
for (String number : numbers) {
59+
System.out.println(number);
60+
}
61+
}
62+
63+
public void printInfo() {
64+
System.out.println("Номер: " + number);
65+
System.out.println("Модель: " + model);
66+
System.out.println("Вес: " + weight);
67+
}
68+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package ru.mirea.practice.s23f0011;
2+
3+
public class Task3 {
4+
String fullName;
5+
int age;
6+
7+
public Task3() {
8+
fullName = "Человек без имени";
9+
age = 0;
10+
}
11+
12+
public Task3(String fullName, int age) {
13+
this.fullName = fullName;
14+
this.age = age;
15+
}
16+
17+
public static void main(String[] args) {
18+
19+
Task3 person1 = new Task3();
20+
person1.move();
21+
person1.talk();
22+
23+
Task3 person2 = new Task3("Наиль Маратович", 30);
24+
person2.move();
25+
person2.talk();
26+
}
27+
28+
public void move() {
29+
System.out.println(fullName + " идет.");
30+
}
31+
32+
public void talk() {
33+
System.out.println(fullName + " говорит.");
34+
}
35+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package ru.mirea.practice.s23f0011;
2+
3+
public class Task4 {
4+
private final double[][] matrix;
5+
private final int rows;
6+
private final int cols;
7+
8+
public Task4(int rows, int cols) {
9+
this.rows = rows;
10+
this.cols = cols;
11+
matrix = new double[rows][cols];
12+
}
13+
14+
public static void main(String[] args) {
15+
Task4 matrix1 = new Task4(2, 3);
16+
matrix1.set(0, 0, 1);
17+
matrix1.set(0, 1, 2);
18+
matrix1.set(0, 2, 3);
19+
matrix1.set(1, 0, 4);
20+
matrix1.set(1, 1, 5);
21+
matrix1.set(1, 2, 6);
22+
23+
Task4 matrix2 = new Task4(2, 3);
24+
matrix2.set(0, 0, 7);
25+
matrix2.set(0, 1, 8);
26+
matrix2.set(0, 2, 9);
27+
matrix2.set(1, 0, 10);
28+
matrix2.set(1, 1, 11);
29+
matrix2.set(1, 2, 12);
30+
31+
Task4 sum = matrix1.add(matrix2);
32+
System.out.println("Сумма матриц:");
33+
sum.print();
34+
35+
Task4 multiplied = matrix1.multiply(2);
36+
System.out.println("Матрица, умноженная на 2:");
37+
multiplied.print();
38+
}
39+
40+
public Task4 add(Task4 other) {
41+
if (rows != other.rows || cols != other.cols) {
42+
throw new IllegalArgumentException("Матрицы должны иметь одинаковые размеры");
43+
}
44+
Task4 result = new Task4(rows, cols);
45+
for (int i = 0; i < rows; i++) {
46+
for (int j = 0; j < cols; j++) {
47+
result.matrix[i][j] = matrix[i][j] + other.matrix[i][j];
48+
}
49+
}
50+
return result;
51+
}
52+
53+
public Task4 multiply(double scalar) {
54+
Task4 result = new Task4(rows, cols);
55+
for (int i = 0; i < rows; i++) {
56+
for (int j = 0; j < cols; j++) {
57+
result.matrix[i][j] = matrix[i][j] * scalar;
58+
}
59+
}
60+
return result;
61+
}
62+
63+
public void print() {
64+
for (int i = 0; i < rows; i++) {
65+
for (int j = 0; j < cols; j++) {
66+
System.out.print(matrix[i][j] + " ");
67+
}
68+
System.out.println();
69+
}
70+
}
71+
72+
public void set(int row, int col, double value) {
73+
matrix[row][col] = value;
74+
}
75+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package ru.mirea.practice.s23f0011.task9;
2+
3+
class Chair extends Furniture {
4+
public Chair(String name, String material, double price) {
5+
super(name, material, price);
6+
}
7+
8+
public double calculatePrice() {
9+
return price * 1.1; // Дополнительная наценка 10% на стулья
10+
}
11+
}

0 commit comments

Comments
 (0)