You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a method setAccountRating that looks at an Account's AnnualRevenue, and sets the value of the Rating picklist field based on the following criteria:
Accounts with AnnualRevenue less than or equal to 100,000 get a rating of "Cold"
Accounts with AnnualRevenue less than or equal to 500,000 but greater than 100,000 get a rating of "Warm"
Accounts with AnnualRevenue greater than 500,000 get a rating of "Hot"
Given the following test code:
Account a = new Account(AnnualRevenue = 150000);
setAccountRating(a);
The expression a.Rating == 'Warm' should be true because the AnnualRevenue was over 100,000 but less than 500,000