Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit 476fd86

Browse files
committed
Лабораторная 17-19
1 parent aac5a0a commit 476fd86

File tree

5 files changed

+46
-12
lines changed

5 files changed

+46
-12
lines changed

students/23K1302/23K1302-p18/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,4 @@
1010
</parent>
1111
<artifactId>23K1302-p18</artifactId>
1212
<description>Задание 18</description>
13-
<build>
14-
<plugins>
15-
<plugin>
16-
<groupId>org.apache.maven.plugins</groupId>
17-
<artifactId>maven-compiler-plugin</artifactId>
18-
<configuration>
19-
<source>14</source>
20-
<target>14</target>
21-
</configuration>
22-
</plugin>
23-
</plugins>
24-
</build>
2513
</project>

students/23K1302/23K1302-p19/pom.xml

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="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>23K1302</artifactId>
7+
<groupId>ru.mirea.practice</groupId>
8+
<version>2024.1</version>
9+
<relativePath>../pom.xml</relativePath>
10+
</parent>
11+
<artifactId>23K1302-p19</artifactId>
12+
<description>Задание 19</description>
13+
</project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package ru.mirea.practice.s0000001;
2+
3+
public final class Ex1 {
4+
5+
private Ex1() {
6+
// NONE
7+
}
8+
9+
public static void main(String[] args) {
10+
try {
11+
String inn = "12345967890";
12+
13+
validateInn(inn);
14+
System.out.println("Заказ успешно оформлен!");
15+
} catch (InvalidInnException e) {
16+
System.out.println("Ошибка: " + e.getMessage());
17+
}
18+
}
19+
20+
public static void validateInn(String inn) throws InvalidInnException {
21+
if (inn.length() != 10) {
22+
throw new InvalidInnException("Недействительный ИНН: " + inn);
23+
}
24+
}
25+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package ru.mirea.practice.s0000001;
2+
3+
public class InvalidInnException extends Exception {
4+
public InvalidInnException(String message) {
5+
super(message);
6+
}
7+
}

students/23K1302/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
<module>23K1302-p16</module>
3333
<module>23K1302-p17</module>
3434
<module>23K1302-p18</module>
35+
<module>23K1302-p19</module>
3536
</modules>
3637
</project>

0 commit comments

Comments
 (0)