Skip to content

Commit

Permalink
Лабораторная 17-19
Browse files Browse the repository at this point in the history
  • Loading branch information
Timmmmofey committed Nov 8, 2024
1 parent aac5a0a commit 476fd86
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 12 deletions.
12 changes: 0 additions & 12 deletions students/23K1302/23K1302-p18/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,4 @@
</parent>
<artifactId>23K1302-p18</artifactId>
<description>Задание 18</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>14</source>
<target>14</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
13 changes: 13 additions & 0 deletions students/23K1302/23K1302-p19/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>23K1302</artifactId>
<groupId>ru.mirea.practice</groupId>
<version>2024.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>23K1302-p19</artifactId>
<description>Задание 19</description>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package ru.mirea.practice.s0000001;

public final class Ex1 {

private Ex1() {
// NONE
}

public static void main(String[] args) {
try {
String inn = "12345967890";

validateInn(inn);
System.out.println("Заказ успешно оформлен!");
} catch (InvalidInnException e) {
System.out.println("Ошибка: " + e.getMessage());
}
}

public static void validateInn(String inn) throws InvalidInnException {
if (inn.length() != 10) {
throw new InvalidInnException("Недействительный ИНН: " + inn);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package ru.mirea.practice.s0000001;

public class InvalidInnException extends Exception {
public InvalidInnException(String message) {
super(message);
}
}
1 change: 1 addition & 0 deletions students/23K1302/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
<module>23K1302-p16</module>
<module>23K1302-p17</module>
<module>23K1302-p18</module>
<module>23K1302-p19</module>
</modules>
</project>

0 comments on commit 476fd86

Please sign in to comment.