Key Accounts WrapperReading Only
You need to build an analysis tool that identifies key accounts across multiple industries and calculates key metrics for reporting purposes.
For this problem, we define minimum annual revenue thresholds an account must meet to be considered a key account. The annual revenue thresholds are defined by industry:
* Banking: 600,000
* Technology: 800,000
* Retail: 2,000,000
* Manufacturing: 500,000
Complete the KeyAccountWrapper
and implement the analyzeKeyAccounts
method in the AnnualThresholdCalculator
class.
KeyAccountWrapper
will need the following properties:
* A String named Industry
to store the industry being analyzed
* A Set of Ids named keyAccountIds
used to qualify as key accounts
* A Decimal named averageKeyAnnualRevenue
to store the Average annual revenue of key accounts in this industry
Example
Input
Account a1 = new Account(); a1.Id = '001000000000001'; a1.AnnualRevenue = 750000; a1.Industry = 'Technology'; Account a2 = new Account(); a2.Id = '001000000000002'; a2.AnnualRevenue = 900000; a2.Industry = 'Technology'; Account a3 = new Account(); a3.Id = '001000000000003'; a3.AnnualRevenue = 700000; a3.Industry = 'Banking'; List<Account> accounts = new List<Account>{a1, a2, a3}; AnnualThresholdCalculator calc = new AnnualThresholdCalculator(); List<KeyAccountWrapper> results = calc.analyzeKeyAccounts(accounts);
Expected results: (2 wrappers returned in the list):
industry='Technology', keyAccountIds={a2.Id}, averageKeyAnnualRevenue=900000
industry='Banking', keyAccountIds={a3.Id}, averageKeyAnnualRevenue=700000
Notes
- If an industry has no accounts that qualify as key accounts, do not include a wrapper for that industry
- Handle null/empty revenue values appropriately
- Industry matching should be case-sensitive
- Return empty List if no industries have key accounts
- Only calculate average from accounts that actually qualify as key accounts