-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aac5a0a
commit 476fd86
Showing
5 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
25 changes: 25 additions & 0 deletions
25
students/23K1302/23K1302-p19/src/main/java/ru/mirea/practice/s0000001/Ex1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...nts/23K1302/23K1302-p19/src/main/java/ru/mirea/practice/s0000001/InvalidInnException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters