Модуль: IB DP Paper 2 HL May 2019


4. 16-b

When the number of customers in the supermarket is low, some check-out counters will close. When there are many customers waiting, a new check-out counter will open.

(b) Construct the code for a method split (part of the class POSsystem), that takes an existing, non-empty POSline as a parameter. It should copy every second cart from  the original line into a new line. Afterwards it should delete every second cart from the original line.
An example call in POSsystem would be: POSline number2 = split(number1), where number1 is an existing POSline.
You may use any method declared or developed. [8]
As a result of the simulation, the company has decided to create a new POS system for their supermarkets.
There have been discussions about adapting existing open source code when developing modules of the new POS system.

Вставьте недостающие фрагменты кода
Java
Напишите программу ниже