Олимпиадный тренинг

Задача . CS SL 2017 Paper 2 - Option D


Задача

Темы:
The company employs several sales personnel to sell its products to different retailers.
Each branch of the company keeps track of its own sales with a suite of programs that include the two classes SalesPerson and Sales.

(a) Complete the constructor public SalesPerson(String id), from the SalesPerson class.
(b) Construct the method calcTotalSales(), in the SalesPerson class that calculates the total value of the sales for a specific SalesPerson object.

The salesPeople array contains 100 instantiated objects.
The company wishes to reward the salesperson whose sales have the largest total value.
(c) By making use of any previously written methods, construct the method highest(), that returns the ID of the salesperson whose sales have the largest total value.
(d) Construct the method addSales(Sales s, String id), in the Main class, that will add a new Sales object s, to the salesperson with a specified ID.
Note: You can assume that the ID is a valid one.
 

time 500 ms
memory 256 Mb
Правила оформления программ и список ошибок при автоматической проверке задач

Статистика успешных решений по компиляторам
 Кол-во
Java2
Комментарий учителя