Прайсы: 8 уровень, 11 лекция Java Core / Prices: level 8, lesson 11 JavaRush

Опубликовано: 02 Май 2026
на канале: Serhii Il
70
2

00:00 - 1
04:38 - 2
06:00 - 3


Прайсы: 8 уровень, 11 лекция Java Core /
Prices: level 8, lesson 11 JavaRush


Задание от JavaRush
Прайсы: 8 уровень, 11 лекция Java Core
Считать с консоли имя файла.
При запуске программы без параметров список товаров должен остаться неизменным.
При запуске программы с параметрами "-c productName price quantity" в конец файла должна добавится новая строка с товаром.
где id - 8 символов. productName - название товара - 30 символов. price - цена - 8 символов. quantity - количество - 4 символа. Данные дополнены пробелами до их длины.
-c - добавляет товар с заданными параметрами в конец файла, генерирует id самостоятельно, инкрементируя максимальный id, найденный в файле.
Созданные для файлов потоки должны быть закрыты.
Пример: 198478 Шорты пляжные черные с рисунко173.00 17



The task from JavaRush
Prices: level 8, lesson 11 Java Core
Read the file name from the console.
When starting the program without parameters, the list of products should remain unchanged.
When you run the program with the "-c productName price quantity" parameters, a new line with the product should be added to the end of the file.
where id is 8 characters. productName - product name - 30 characters. price - price - 8 characters. quantity - quantity - 4 characters. The data is padded with spaces to its length.
quantity, 4 characters.
-c - adds a product with the specified parameters to the end of the file, generates an id on its own, incrementing the maximum id found in the file.
Streams created for files must be closed.
Example: 198478 Black beach shorts with a patt173.00 17




Java Developer
Android Studio
Язык программирования Джава
Андроид Студио



Repeat after me, then delete and write the code from memory. Create a new task and write the program yourself
Повтори за мной, затем удали и напиши код по памяти. Придумай новое задание и напиши программу самостоятельно


Thank you for watching
Спасибо за просмотр