File tree Expand file tree Collapse file tree 8 files changed +85
-1
lines changed
Expand file tree Collapse file tree 8 files changed +85
-1
lines changed Original file line number Diff line number Diff line change 88
99## Блок 2. Основы Java, Авто-тесты и CI
1010
11- 2.1. [ ] [ Примитивные типы данных, переменные и условные операторы ] ( data )
11+ 2.1. [ x ] [ Примитивные типы данных, условия ] ( data )
1212
13132.2. [ ] [ Системы сборки и авто-тесты] ( maven-junit )
1414
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments