Напишите программу ниже |
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
class SalesPerson // each object contains details of one salesperson
{
private String id;
private Sales[] salesHistory; // details of the different sales
private int count = 0; // number of sales made
//constructor for a new salesperson
public SalesPerson (String id)
{
|
|
}
// constructor for a salesperson transferred (together with
// their sales details) from another branch
public SalesPerson(String id, Sales[] s, int c)
{
// code missing
}
public int getCount(){return count;}
public String getId() {return id;}
public void setSalesHistory(Sales s)
{
salesHistory[count] = s;
count = count +1;
}
public double calcTotalSales() // calculates total sales for the salesperson
{
// code missing
|
|
}
}
class Sales // each object contains details of one sale
{
private String itemId; // id of the item
private double value; // the price of one item
private int quantity; // the number of the items sold
// constructor missing
public Sales(String itemid, double value, int quantity)
{
this.itemId = itemid;
this.value = value;
this.quantity = quantity;
}
public double getValue() {return value;}
public int getQuantity() {return quantity;}
}
|
|