Count open cases
An Integer is a whole number.
LessonRead this before the challenge.
An Integer holds a whole number, like a count of records. You write the digits with no quotes:
Integer seats = 12;Quotes change the meaning. '12' is text that happens to look like a number. Apex checks types, so it will not put text into an Integer box:
Integer seats = '12';That line stops with the error Illegal assignment from String to Integer. Drop the quotes and the error goes away.
Why does it matter? You can do math with an Integer, so seats + 1 gives 13. With text, '12' + 1 gives the text 121, because + on text joins the pieces. Keep counts as numbers from the start.
Your task
The script also tracks how many support cases are still open for the client. A count is a whole number, so it lives in an Integer. Right now openCases is null.
In the starter, set openCases to the number 4. Write the digit with no quotes, keep the Integer type and the semicolon, and leave the company name line as it is.
For example, Integer closedCases = 12; stores the number 12 because digits with no quotes are a number in Apex.
String companyName = 'RidgePoint Capital';
Integer openCases = null;
String city = 'Denver';
Boolean active = true;Requirements
- Stores the number 4 in openCases
- Keeps openCases as an Integer
- Gives openCases a real value instead of null
- Writes the count as a number, not text in quotes
- Leaves the company name line unchanged