English
Tasks
Complete the task of the chosen difficulty level for your variant number.
Variants
Variant 1. VAT calculator
1. Initial level. Create a Java console program using JDK 27: read an amount 0..1000000 and a command add/remove/exit; use an educational rate of 20 percent, add=s*1.2, remove=s/1.2; print the base, tax, and total. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read an amount 0..1000000 and a command add/remove/exit; use an educational rate of 20 percent, add=s*1.2, remove=s/1.2; print the base, tax, and total. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read an amount 0..1000000 and a command add/remove/exit; use an educational rate of 20 percent, add=s*1.2, remove=s/1.2; print the base, tax, and total. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 2. Guess the number
1. Initial level. Create a Java console program using JDK 27: set a secret number 1..100, read up to 7 guesses, and report higher/lower/correct; an invalid token does not use up a guess, and EOF ends the game. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: set a secret number 1..100, read up to 7 guesses, and report higher/lower/correct; an invalid token does not use up a guess, and EOF ends the game. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: set a secret number 1..100, read up to 7 guesses, and report higher/lower/correct; an invalid token does not use up a guess, and EOF ends the game. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 3. Leap years
1. Initial level. Create a Java console program using JDK 27: read bounds a,b 1..9999 with a<=b; print leap years using the rule divisible by 400 or by 4 but not 100, and their count. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read bounds a,b 1..9999 with a<=b; print leap years using the rule divisible by 400 or by 4 but not 100, and their count. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read bounds a,b 1..9999 with a<=b; print leap years using the rule divisible by 400 or by 4 but not 100, and their count. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 4. Number systems
1. Initial level. Create a Java console program using JDK 27: read integer n 0..65535 and base 2, 8, or 16; print n in the selected base and its number of set bits. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read integer n 0..65535 and base 2, 8, or 16; print n in the selected base and its number of set bits. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read integer n 0..65535 and base 2, 8, or 16; print n in the selected base and its number of set bits. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 5. Cash register
1. Initial level. Create a Java console program using JDK 27: read an amount 0..100000 divisible by 10; dispense the minimum number of banknotes of 100, 50, 20, and 10 and verify that they reconstruct the amount. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read an amount 0..100000 divisible by 10; dispense the minimum number of banknotes of 100, 50, 20, and 10 and verify that they reconstruct the amount. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read an amount 0..100000 divisible by 10; dispense the minimum number of banknotes of 100, 50, 20, and 10 and verify that they reconstruct the amount. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 6. Multiplication table
1. Initial level. Create a Java console program using JDK 27: read n 1..20; print an aligned table of products for 1..n and the sum of each row. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read n 1..20; print an aligned table of products for 1..n and the sum of each row. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read n 1..20; print an aligned table of products for 1..n and the sum of each row. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 7. Prime numbers
1. Initial level. Create a Java console program using JDK 27: read a,b 2..100000 with a<=b and b-a<=10000; print the prime numbers and the number of pairs differing by 2; test divisors up to d<=n/d. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read a,b 2..100000 with a<=b and b-a<=10000; print the prime numbers and the number of pairs differing by 2; test divisors up to d<=n/d. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read a,b 2..100000 with a<=b and b-a<=10000; print the prime numbers and the number of pairs differing by 2; test divisors up to d<=n/d. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 8. ATM
1. Initial level. Create a Java console program using JDK 27: start with a balance of 10000 kopiykas, educational PIN 2468, and three attempts; after login, accept balance/withdraw/exit commands, with an amount 1..10000 not exceeding the balance; print the unchanged balance after rejection. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: start with a balance of 10000 kopiykas, educational PIN 2468, and three attempts; after login, accept balance/withdraw/exit commands, with an amount 1..10000 not exceeding the balance; print the unchanged balance after rejection. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: start with a balance of 10000 kopiykas, educational PIN 2468, and three attempts; after login, accept balance/withdraw/exit commands, with an amount 1..10000 not exceeding the balance; print the unchanged balance after rejection. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 9. ECTS scale
1. Initial level. Create a Java console program using JDK 27: read integer scores 0..100; use the local rule A90..100,B82..89,C74..81,D64..73,E60..63,F0..59; print the letter and number of scores processed. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read integer scores 0..100; use the local rule A90..100,B82..89,C74..81,D64..73,E60..63,F0..59; print the letter and number of scores processed. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read integer scores 0..100; use the local rule A90..100,B82..89,C74..81,D64..73,E60..63,F0..59; print the letter and number of scores processed. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 10. Calendar intervals
1. Initial level. Create a Java console program using JDK 27: read a month number 1..12 and year 1..9999; print the number of days with a leap-year check and the quarter number, without astrological claims. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read a month number 1..12 and year 1..9999; print the number of days with a leap-year check and the quarter number, without astrological claims. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read a month number 1..12 and year 1..9999; print the number of days with a leap-year check and the quarter number, without astrological claims. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 11. Day of the week
1. Initial level. Create a Java console program using JDK 27: read n days since a known Monday, 0..1000000; print the weekday using n%7 and the number of complete weeks. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read n days since a known Monday, 0..1000000; print the weekday using n%7 and the number of complete weeks. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read n days since a known Monday, 0..1000000; print the weekday using n%7 and the number of complete weeks. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 12. Educational tax calculation
1. Initial level. Create a Java console program using JDK 27: read nonnegative incomes 0..1000000 until EOF; given hypothetical rates of 18 and 5 percent, print both amounts and the remainder; do not treat the rates as current law. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read nonnegative incomes 0..1000000 until EOF; given hypothetical rates of 18 and 5 percent, print both amounts and the remainder; do not treat the rates as current law. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read nonnegative incomes 0..1000000 until EOF; given hypothetical rates of 18 and 5 percent, print both amounts and the remainder; do not treat the rates as current law. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 13. Hypothetical indicator zones
1. Initial level. Create a Java console program using JDK 27: read maximum m 1..1000 and percentage boundaries 50, 60, 70, 80, 90; print an educational table of m*p/100 without medical advice. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read maximum m 1..1000 and percentage boundaries 50, 60, 70, 80, 90; print an educational table of m*p/100 without medical advice. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read maximum m 1..1000 and percentage boundaries 50, 60, 70, 80, 90; print an educational table of m*p/100 without medical advice. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 14. Taylor series
1. Initial level. Create a Java console program using JDK 27: read x from -5 to 5 and epsilon 1e-12..1e-3; calculate e^x by summing terms t*=x/k until abs(t)<epsilon or 100 terms; print the sum and number of terms. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read x from -5 to 5 and epsilon 1e-12..1e-3; calculate e^x by summing terms t*=x/k until abs(t)<epsilon or 100 terms; print the sum and number of terms. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read x from -5 to 5 and epsilon 1e-12..1e-3; calculate e^x by summing terms t*=x/k until abs(t)<epsilon or 100 terms; print the sum and number of terms. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 15. Fibonacci
1. Initial level. Create a Java console program using JDK 27: read n 0..92; print F0=0,F1=1 and subsequent values through Fn using long, checking for overflow before addition. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read n 0..92; print F0=0,F1=1 and subsequent values through Fn using long, checking for overflow before addition. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read n 0..92; print F0=0,F1=1 and subsequent values through Fn using long, checking for overflow before addition. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 16. Digits of a number
1. Initial level. Create a Java console program using JDK 27: read n 0..1000000000; print the digit sum, digit count, and whether it is a numeric palindrome; zero has one digit. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read n 0..1000000000; print the digit sum, digit count, and whether it is a numeric palindrome; zero has one digit. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read n 0..1000000000; print the digit sum, digit count, and whether it is a numeric palindrome; zero has one digit. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 17. Coffee vending machine
1. Initial level. Create a Java console program using JDK 27: use a menu with tea for 30, coffee for 40, and cocoa for 50 UAH; read a choice and payment 0..1000; reject insufficient payment, otherwise print change; exit terminates. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: use a menu with tea for 30, coffee for 40, and cocoa for 50 UAH; read a choice and payment 0..1000; reject insufficient payment, otherwise print change; exit terminates. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: use a menu with tea for 30, coffee for 40, and cocoa for 50 UAH; read a choice and payment 0..1000; reject insufficient payment, otherwise print change; exit terminates. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 18. Taxi
1. Initial level. Create a Java console program using JDK 27: read kilometers 0..1000, waiting minutes 0..1440, and night true/false; the educational fare is 50+12km+2min, with a nighttime multiplier of 1.2; print an itemized breakdown. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read kilometers 0..1000, waiting minutes 0..1440, and night true/false; the educational fare is 50+12km+2min, with a nighttime multiplier of 1.2; print an itemized breakdown. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read kilometers 0..1000, waiting minutes 0..1440, and night true/false; the educational fare is 50+12km+2min, with a nighttime multiplier of 1.2; print an itemized breakdown. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 19. Pascal's triangle
1. Initial level. Create a Java console program using JDK 27: read n 1..20; print n rows, calculating the next coefficient in a row as c*(row-k)/(k+1) using long. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read n 1..20; print n rows, calculating the next coefficient in a row as c*(row-k)/(k+1) using long. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read n 1..20; print n rows, calculating the next coefficient in a row as c*(row-k)/(k+1) using long. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 20. Linear temperature scale
1. Initial level. Create a Java console program using JDK 27: read a,b from -100 to 100 with a<=b and an integer step 1..20; print Celsius and Fahrenheit=1.8*C+32; do not provide clothing recommendations. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read a,b from -100 to 100 with a<=b and an integer step 1..20; print Celsius and Fahrenheit=1.8*C+32; do not provide clothing recommendations. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read a,b from -100 to 100 with a<=b and an integer step 1..20; print Celsius and Fahrenheit=1.8*C+32; do not provide clothing recommendations. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 21. Chess knight
1. Initial level. Create a Java console program using JDK 27: read two integer coordinates x,y 1..8; enumerate offsets from -2 to 2 with abs(dx)*abs(dy)==2, printing only squares on the board. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read two integer coordinates x,y 1..8; enumerate offsets from -2 to 2 with abs(dx)*abs(dy)==2, printing only squares on the board. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read two integer coordinates x,y 1..8; enumerate offsets from -2 to 2 with abs(dx)*abs(dy)==2, printing only squares on the board. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 22. GCD and LCM
1. Initial level. Create a Java console program using JDK 27: read a,b 1..1000000; find GCD using the Euclidean algorithm and LCM=(a/GCD)*b using long; also print the reduced fraction. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read a,b 1..1000000; find GCD using the Euclidean algorithm and LCM=(a/GCD)*b using long; also print the reduced fraction. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read a,b 1..1000000; find GCD using the Euclidean algorithm and LCM=(a/GCD)*b using long; also print the reduced fraction. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 23. Deposit with contributions
1. Initial level. Create a Java console program using JDK 27: read an initial amount 0..1000000, monthly rate 0..0.05, contribution 0..100000, and months 1..120; each month, balance=balance*(1+r)+add; print an educational table. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read an initial amount 0..1000000, monthly rate 0..0.05, contribution 0..100000, and months 1..120; each month, balance=balance*(1+r)+add; print an educational table. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read an initial amount 0..1000000, monthly rate 0..0.05, contribution 0..100000, and months 1..120; each month, balance=balance*(1+r)+add; print an educational table. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 24. Elevator
1. Initial level. Create a Java console program using JDK 27: start on floor 1; read integer calls 1..20 until 0; travel time is 3 seconds per floor plus 5 per stop; print the route and total time. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: start on floor 1; read integer calls 1..20 until 0; travel time is 3 seconds per floor plus 5 per stop; print the route and total time. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: start on floor 1; read integer calls 1..20 until 0; travel time is 3 seconds per floor plus 5 per stop; print the route and total time. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 25. Character shapes
1. Initial level. Create a Java console program using JDK 27: read odd n 1..39; print a diamond of height n using * characters, determining each row's indentation and width with loops. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read odd n 1..39; print a diamond of height n using * characters, determining each row's indentation and width with loops. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read odd n 1..39; print a diamond of height n using * characters, determining each row's indentation and width with loops. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 26. Arithmetic trainer
1. Initial level. Create a Java console program using JDK 27: for k 1..10, ask questions k+(11-k); read integer answers and count correct and incorrect answers; EOF ends with a summary. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: for k 1..10, ask questions k+(11-k); read integer answers and count correct and incorrect answers; EOF ends with a summary. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: for k 1..10, ask questions k+(11-k); read integer answers and count correct and incorrect answers; EOF ends with a summary. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 27. Duration in seconds
1. Initial level. Create a Java console program using JDK 27: read t 0..1000000000; print whole weeks, days, hours, minutes, and seconds and verify reconstruction of t. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read t 0..1000000000; print whole weeks, days, hours, minutes, and seconds and verify reconstruction of t. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read t 0..1000000000; print whole weeks, days, hours, minutes, and seconds and verify reconstruction of t. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 28. Class bell schedule
1. Initial level. Create a Java console program using JDK 27: read start h 0..23, m 0..59, number of classes 1..10, duration 1..120 min, and break 0..60 min; print each class's start/end with the day number. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read start h 0..23, m 0..59, number of classes 1..10, duration 1..120 min, and break 0..60 min; print each class's start/end with the day number. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read start h 0..23, m 0..59, number of classes 1..10, duration 1..120 min, and break 0..60 min; print each class's start/end with the day number. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 29. Roman numerals
1. Initial level. Create a Java console program using JDK 27: read n 1..10; use a switch expression to print I, II, III, IV, V, VI, VII, VIII, IX, X; reject other values. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read n 1..10; use a switch expression to print I, II, III, IV, V, VI, VII, VIII, IX, X; reject other values. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read n 1..10; use a switch expression to print I, II, III, IV, V, VI, VII, VIII, IX, X; reject other values. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Variant 30. Water meter
1. Initial level. Create a Java console program using JDK 27: read consecutive nonnegative readings until EOF, each no smaller than the previous one; with a rate of 20 UAH/m³, print consumption and the bill for each interval; rejected input does not change the last reading. Use appropriate branches and loops; explain invalid input without producing an incorrect total.
2. Basic level. Create a Java console program using JDK 27: read consecutive nonnegative readings until EOF, each no smaller than the previous one; with a rate of 20 UAH/m³, print consumption and the bill for each interval; rejected input does not change the last reading. Repeat input after an invalid line and handle EOF explicitly; track the number of successful calculations and test both boundaries and an empty stream.
3. Advanced level. Create a Java console program using JDK 27: read consecutive nonnegative readings until EOF, each no smaller than the previous one; with a rate of 20 UAH/m³, print consumption and the bill for each interval; rejected input does not change the last reading. Provide a repeating menu with an exit option; read initial parameters from the CLI as key=value, or from the keyboard when there are no arguments; prove that the loops terminate. Add --help and checks for format, finite numbers, and bounds; print errors to stderr, using exit codes 0 for success/help, 2 for invalid input, and 1 for an operational failure. Print an aligned report with a total. Submit at least five test cases, a README, and local Git history.
Procedure
- Record the ranges and format of the input data.
- Choose types with room for intermediate results.
- Implement format, bounds, and EOF checks.
- Explain the termination condition for every loop.
- Compare the result with a manual calculation.
- Check an invalid token, zero, and both boundaries.
- Submit source code, a README, and Git history.