Skip to content

Commit 0697b04

Browse files
author
coursar
committed
feat(data)
1 parent 965cb34 commit 0697b04

File tree

8 files changed

+85
-1
lines changed

8 files changed

+85
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Блок 2. Основы Java, Авто-тесты и CI
1010

11-
2.1. [ ] [Примитивные типы данных, переменные и условные операторы](data)
11+
2.1. [x] [Примитивные типы данных, условия](data)
1212

1313
2.2. [ ] [Системы сборки и авто-тесты](maven-junit)
1414

data/bonus/out/.gitkeep

Whitespace-only changes.

data/bonus/src/MainV1.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class MainV1 {
2+
public static void main(String[] args) {
3+
boolean registered = true;
4+
float amount = 1000.60F;
5+
float percent = 0.03F;
6+
7+
float bonus = amount * percent;
8+
System.out.println(bonus);
9+
}
10+
}

data/bonus/src/MainV2.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class MainV2 {
2+
public static void main(String[] args) {
3+
boolean registered = true;
4+
long amount = 100060;
5+
int percent = 3;
6+
7+
long bonus = amount / 100 * percent / 100;
8+
System.out.println(bonus);
9+
}
10+
}
11+

data/bonus/src/MainV3.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class MainV3 {
2+
public static void main(String[] args) {
3+
boolean registered = true;
4+
long amount = 100060;
5+
int percent = 3;
6+
7+
long bonus = amount * percent / 100 / 100;
8+
System.out.println(bonus);
9+
}
10+
}
11+

data/bonus/src/MainV4.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class MainV4 {
2+
public static void main(String[] args) {
3+
boolean registered = true;
4+
int percent;
5+
if (registered) {
6+
percent = 3;
7+
} else {
8+
percent = 1;
9+
}
10+
long amount = 100060;
11+
long bonus = amount * percent / 100 / 100;
12+
System.out.println(bonus);
13+
}
14+
}
15+
16+
17+

data/bonus/src/MainV5.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
public class MainV5 {
2+
public static void main(String[] args) {
3+
boolean registered = true;
4+
int percent;
5+
if (registered) {
6+
percent = 3;
7+
} else {
8+
percent = 1;
9+
}
10+
long amount = 100060;
11+
long bonus = amount * percent / 100 / 100;
12+
long limit = 500;
13+
if (bonus > limit) {
14+
bonus = limit;
15+
}
16+
System.out.println(bonus);
17+
}
18+
}
19+
20+

data/bonus/src/MainV6.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public class MainV6 {
2+
public static void main(String[] args) {
3+
boolean registered = true;
4+
int percent = registered ? 3 : 1;
5+
long amount = 100060;
6+
long bonus = amount * percent / 100 / 100;
7+
long limit = 500;
8+
if (bonus > limit) {
9+
bonus = limit;
10+
}
11+
System.out.println(bonus);
12+
}
13+
}
14+
15+

0 commit comments

Comments
 (0)