English
Tasks
Complete the task of the chosen difficulty level for your variant number.
Use Kotlin/JVM, JDK 27, UTF-8, pinned dependencies, and separate temporary directories for tests. Fully describe the input format and the policy for a corrupted file; do not silently replace it with empty data.
Variants
Variant 1. Address book
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, phone:String. Validate: unique positive ids, non-empty name and phone. Implement search by name prefix. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, phone:String. Validate: unique positive ids, non-empty name and phone. Implement search by name prefix. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, phone:String. Validate: unique positive ids, non-empty name and phone. Implement search by name prefix. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 2. Notes
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, text:String. Validate: unique positive ids and non-empty text. Implement CRUD and ordering by id. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, text:String. Validate: unique positive ids and non-empty text. Implement CRUD and ordering by id. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, text:String. Validate: unique positive ids and non-empty text. Implement CRUD and ordering by id. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 3. Expense tracking
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, category:String, cents:Long. Validate: non-empty category, non-negative kopiykas. Implement monthly totals by category. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, category:String, cents:Long. Validate: non-empty category, non-negative kopiykas. Implement monthly totals by category. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, category:String, cents:Long. Validate: non-empty category, non-negative kopiykas. Implement monthly totals by category. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 4. Game settings
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: name:String, volume:Int, fullscreen:Boolean. Validate: non-empty name, volume 0..100. Implement the defaults volume=50 and fullscreen=false. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: name:String, volume:Int, fullscreen:Boolean. Validate: non-empty name, volume 0..100. Implement the defaults volume=50 and fullscreen=false. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: name:String, volume:Int, fullscreen:Boolean. Validate: non-empty name, volume 0..100. Implement the defaults volume=50 and fullscreen=false. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 5. Workout log
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, activity:String, minutes:Int. Validate: non-empty activity and minutes 1..1440. Implement total minutes by activity; the data is fictitious. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, activity:String, minutes:Int. Validate: non-empty activity and minutes 1..1440. Implement total minutes by activity; the data is fictitious. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, activity:String, minutes:Int. Validate: non-empty activity and minutes 1..1440. Implement total minutes by activity; the data is fictitious. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 6. Media library
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, kind:film/series/podcast, title:String, minutes:Int. Validate: unique ids, non-empty title, positive duration. Implement duration totals by kind; a sealed schema for JSON. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, kind:film/series/podcast, title:String, minutes:Int. Validate: unique ids, non-empty title, positive duration. Implement duration totals by kind; a sealed schema for JSON. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, kind:film/series/podcast, title:String, minutes:Int. Validate: unique ids, non-empty title, positive duration. Implement duration totals by kind; a sealed schema for JSON. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 7. Class timetable
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: day:Int, start:Int, end:Int, room:String. Validate: day 1..7, 0<=start<end<=1440, non-empty room. Implement overlaps of half-open intervals within one room. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: day:Int, start:Int, end:Int, room:String. Validate: day 1..7, 0<=start<end<=1440, non-empty room. Implement overlaps of half-open intervals within one room. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: day:Int, start:Int, end:Int, room:String. Validate: day 1..7, 0<=start<end<=1440, non-empty room. Implement overlaps of half-open intervals within one room. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 8. Group grades
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, score:Int. Validate: unique ids, non-empty name, score 0..100. Implement the average and the share of scores of at least 60. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, score:Int. Validate: unique ids, non-empty name, score 0..100. Implement the average and the share of scores of at least 60. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, score:Int. Validate: unique ids, non-empty name, score 0..100. Implement the average and the share of scores of at least 60. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 9. Stocktaking
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: code:String, count:Int. Validate: unique non-empty codes and non-negative counts. Implement the difference between two warehouse snapshots by code. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: code:String, count:Int. Validate: unique non-empty codes and non-negative counts. Implement the difference between two warehouse snapshots by code. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: code:String, count:Int. Validate: unique non-empty codes and non-negative counts. Implement the difference between two warehouse snapshots by code. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 10. Log analysis
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: time:ISO, level:INFO/WARN/ERROR, message:String. Validate: a valid time, an allowed level, a non-empty message. Implement counts per level and a list of errors. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: time:ISO, level:INFO/WARN/ERROR, message:String. Validate: a valid time, an allowed level, a non-empty message. Implement counts per level and a list of errors. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: time:ISO, level:INFO/WARN/ERROR, message:String. Validate: a valid time, an allowed level, a non-empty message. Implement counts per level and a list of errors. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 11. Cookbook
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: name:String, portions:Int, ingredient:String, grams:Int. Validate: portions 1..100, positive grams, non-empty names. Implement scaling to the given number of portions with explicit rounding. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: name:String, portions:Int, ingredient:String, grams:Int. Validate: portions 1..100, positive grams, non-empty names. Implement scaling to the given number of portions with explicit rounding. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: name:String, portions:Int, ingredient:String, grams:Int. Validate: portions 1..100, positive grams, non-empty names. Implement scaling to the given number of portions with explicit rounding. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 12. Terminology dictionary
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: term:String, definition:String. Validate: unique terms and non-empty definitions. Implement case-insensitive term search. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: term:String, definition:String. Validate: unique terms and non-empty definitions. Implement case-insensitive term search. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: term:String, definition:String. Validate: unique terms and non-empty definitions. Implement case-insensitive term search. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 13. To-do list
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, text:String, due:ISO, done:Boolean. Validate: positive unique ids, non-empty text, a valid date. Implement overdue unfinished items as of the entered date; a LocalDate serializer. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, text:String, due:ISO, done:Boolean. Validate: positive unique ids, non-empty text, a valid date. Implement overdue unfinished items as of the entered date; a LocalDate serializer. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, text:String, due:ISO, done:Boolean. Validate: positive unique ids, non-empty text, a valid date. Implement overdue unfinished items as of the entered date; a LocalDate serializer. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 14. Directory analysis
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: path:String, bytes:Long. Validate: only files of the given directory; non-negative bytes. Implement a recursive report without following symbolic links. Pass the input directory path and a separate report path as arguments; show an access error explicitly. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: path:String, bytes:Long. Validate: only files of the given directory; non-negative bytes. Implement a recursive report without following symbolic links. Pass the input directory path and a separate report path as arguments; show an access error explicitly. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: path:String, bytes:Long. Validate: only files of the given directory; non-negative bytes. Implement a recursive report without following symbolic links. Pass the input directory path and a separate report path as arguments; show an access error explicitly. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 15. Weather observations
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: station:String, date:ISO, temperature:Double. Validate: a finite temperature, a non-empty station, a unique pair. Implement min/max/mean per station. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: station:String, date:ISO, temperature:Double. Validate: a finite temperature, a non-empty station, a unique pair. Implement min/max/mean per station. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: station:String, date:ISO, temperature:Double. Validate: a finite temperature, a non-empty station, a unique pair. Implement min/max/mean per station. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 16. Book loans
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: bookId:Int, reader:String, due:ISO, returned:Boolean. Validate: a positive id, a non-empty fictitious reader, a valid date. Implement overdue loans as of a given date. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: bookId:Int, reader:String, due:ISO, returned:Boolean. Validate: a positive id, a non-empty fictitious reader, a valid date. Implement overdue loans as of a given date. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: bookId:Int, reader:String, due:ISO, returned:Boolean. Validate: a positive id, a non-empty fictitious reader, a valid date. Implement overdue loans as of a given date. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 17. Football tournament
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: home:String, away:String, homeGoals:Int, awayGoals:Int. Validate: different non-empty teams and non-negative goals. Implement a table of points 3/1/0, goal difference, and name. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: home:String, away:String, homeGoals:Int, awayGoals:Int. Validate: different non-empty teams and non-negative goals. Implement a table of points 3/1/0, goal difference, and name. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: home:String, away:String, homeGoals:Int, awayGoals:Int. Validate: different non-empty teams and non-negative goals. Implement a table of points 3/1/0, goal difference, and name. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 18. Quiz
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, question:String, answer:A/B/C. Validate: unique ids, a non-empty question, a valid code. Implement grading the entered answers and a results file. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, question:String, answer:A/B/C. Validate: unique ids, a non-empty question, a valid code. Implement grading the entered answers and a results file. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, question:String, answer:A/B/C. Validate: unique ids, a non-empty question, a valid code. Implement grading the entered answers and a results file. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 19. Fuel log
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, distanceKm:Double, liters:Double. Validate: finite non-negative kilometers and positive liters. Implement liters per 100 km for a nonzero total distance. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, distanceKm:Double, liters:Double. Validate: finite non-negative kilometers and positive liters. Implement liters per 100 km for a nonzero total distance. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, distanceKm:Double, liters:Double. Validate: finite non-negative kilometers and positive liters. Implement liters per 100 km for a nonzero total distance. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 20. Cafe menu
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: code:String, name:String, cents:Long. Validate: unique codes, non-empty names, a non-negative price. Implement a receipt by codes and quantities 1..1000. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: code:String, name:String, cents:Long. Validate: unique codes, non-empty names, a non-negative price. Implement a receipt by codes and quantities 1..1000. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: code:String, name:String, cents:Long. Validate: unique codes, non-empty names, a non-negative price. Implement a receipt by codes and quantities 1..1000. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 21. Vaccination card
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: eventId:Int, label:String, planned:ISO. Validate: only fictitious events, positive unique ids, and valid dates. Implement events for the next 7 days from the entered date; without determining medical schedules. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: eventId:Int, label:String, planned:ISO. Validate: only fictitious events, positive unique ids, and valid dates. Implement events for the next 7 days from the entered date; without determining medical schedules. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: eventId:Int, label:String, planned:ISO. Validate: only fictitious events, positive unique ids, and valid dates. Implement events for the next 7 days from the entered date; without determining medical schedules. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 22. Bank statement
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, category:String, cents:Long. Validate: a valid date and a non-empty category. Implement positive income, negative expenses, and the balance. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, category:String, cents:Long. Validate: a valid date and a non-empty category. Implement positive income, negative expenses, and the balance. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: date:ISO, category:String, cents:Long. Validate: a valid date and a non-empty category. Implement positive income, negative expenses, and the balance. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 23. Hiking routes
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: route:String, order:Int, x:Double, y:Double. Validate: a non-empty route, a unique position, finite nominal coordinates. Implement the length of the polyline in Cartesian units. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: route:String, order:Int, x:Double, y:Double. Validate: a non-empty route, a unique position, finite nominal coordinates. Implement the length of the polyline in Cartesian units. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: route:String, order:Int, x:Double, y:Double. Validate: a non-empty route, a unique position, finite nominal coordinates. Implement the length of the polyline in Cartesian units. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 24. Backup
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: relativePath:String, size:Long, modified:ISO. Validate: paths only inside the given input directory, without links. Implement copying new/modified files to a separate directory and a manifest. Pass the input directory path and a separate report path as arguments; show an access error explicitly. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: relativePath:String, size:Long, modified:ISO. Validate: paths only inside the given input directory, without links. Implement copying new/modified files to a separate directory and a manifest. Pass the input directory path and a separate report path as arguments; show an access error explicitly. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: relativePath:String, size:Long, modified:ISO. Validate: paths only inside the given input directory, without links. Implement copying new/modified files to a separate directory and a manifest. Pass the input directory path and a separate report path as arguments; show an access error explicitly. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 25. Music collection
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, title:String, artist:String, seconds:Int. Validate: unique ids, non-empty names, positive seconds. Implement artist search and the duration of a selection. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, title:String, artist:String, seconds:Int. Validate: unique ids, non-empty names, positive seconds. Implement artist search and the duration of a selection. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, title:String, artist:String, seconds:Int. Validate: unique ids, non-empty names, positive seconds. Implement artist search and the duration of a selection. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 26. School olympiad
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, score:Int. Validate: unique ids, fictitious names, score 0..100. Implement a ranking by score descending/name/id. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, score:Int. Validate: unique ids, fictitious names, score 0..100. Implement a ranking by score descending/name/id. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:Int, name:String, score:Int. Validate: unique ids, fictitious names, score 0..100. Implement a ranking by score descending/name/id. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 27. Meter readings
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: meter:String, date:ISO, value:Long, tariffCents:Long. Validate: a unique pair, non-negative values and tariff. Implement the difference between adjacent readings, reject a decrease, price as Long. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: meter:String, date:ISO, value:Long, tariffCents:Long. Validate: a unique pair, non-negative values and tariff. Implement the difference between adjacent readings, reject a decrease, price as Long. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: meter:String, date:ISO, value:Long, tariffCents:Long. Validate: a unique pair, non-negative values and tariff. Implement the difference between adjacent readings, reject a decrease, price as Long. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 28. Game save
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: version:Int, player:String, level:Int, points:Long. Validate: version=1, a non-empty name, level 1..100, non-negative points. Implement a round trip of the state and an explicit rejection of an unknown version. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: version:Int, player:String, level:Int, points:Long. Validate: version=1, a non-empty name, level 1..100, non-negative points. Implement a round trip of the state and an explicit rejection of an unknown version. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: version:Int, player:String, level:Int, points:Long. Validate: version=1, a non-empty name, level 1..100, non-negative points. Implement a round trip of the state and an explicit rejection of an unknown version. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 29. Synonym dictionary
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: word:String, synonym:String. Validate: non-empty different words, no repeated pairs. Implement symmetric lookup and the connected component. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: word:String, synonym:String. Validate: non-empty different words, no repeated pairs. Implement symmetric lookup and the connected component. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: word:String, synonym:String. Validate: non-empty different words, no repeated pairs. Implement symmetric lookup and the connected component. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Variant 30. Train timetable
1. Initial level. Create a Kotlin/JVM console program on JDK 27. Schema: id:String, from:String, to:String, departure:ISO, arrival:ISO. Validate: a unique id, different stations, arrival after departure. Implement a search for direct trips after a given moment. Input is a UTF-8 TSV with a header in the specified order; tabs and line breaks inside fields are forbidden. Pass the paths as arguments. Print a text report. Write two kotlin.test tests: one for the computation and one for an invalid value. An empty report must not divide by zero; compute money without overflow.
2. Basic level. Create a Kotlin/JVM console program on JDK 27. Schema: id:String, from:String, to:String, departure:ISO, arrival:ISO. Validate: a unique id, different stations, arrival after departure. Implement a search for direct trips after a given moment. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable and JSON storage; validate the entire input before writing. Add four tests: round trip, empty set, boundary, and invalid format. An empty report must not divide by zero; compute money without overflow.
3. Advanced level. Create a Kotlin/JVM console program on JDK 27. Schema: id:String, from:String, to:String, departure:ISO, arrival:ISO. Validate: a unique id, different stations, arrival after departure. Implement a search for direct trips after a given moment. Input is a JSON array of objects with the specified fields; pass the paths of the input file and a separate output file as arguments. Use @Serializable; move the storage into a class and implement replacement via a temporary file with an explicit ATOMIC_MOVE policy. Add at least six tests with @TempDir: round trip, missing file, corrupted format, invalid data, empty set, and preservation of the previous file on failure. An empty report must not divide by zero; compute money without overflow. Add CLI arguments in key=value format and --help; with no arguments, read the same fields from the keyboard. Print a labeled tabular report with a total; send errors to stderr. Exit codes: 0 – success or help, 2 – invalid input, 1 – operational failure.
Procedure
- Define the record schema, encoding, constraints, and format version.
- Separate domain computations from file operations.
- Add decoding, data validation, saving, and clear rejections.
- Test the round trip, a missing file, an invalid format, and boundaries.
- Show that the tests use a temporary directory and do not depend on order.
- Run
gradlew testand add the actual report and a table of checks. - Keep the code, Gradle Wrapper, and README without build output or local data.