Course Content
Salesforce Development – Apex
About Lesson

This class covers the below topics

  1. Previous class recap
  2. Statements and Expressions
  3. Operators

Hands-on Exercise:

  1. Calculate simple interest for a principal amount of Rs.4000 at a rate of interest of 18% for a duration of 4 years and store it in a variable named simpleInterest.  Hint: Formula to calculate Simple Interest. (Principal amount * Rate of Interest * No.of years)/100. 
  2. Convert a Fahrenheit value temperature that is stored in a decimal variable named f with value 500.00 to Celsius Value and store it in a variable named cel. Hint: Formula to convert Fahrenheit value to Celsius value: (F-32)*5/9.
  3. Calculate the area of the rectangle based on variables length l and breadth b and store it a variable named area Values of length and breadth are 500.00 and 25.00.
  4. Create a constant integer variable named PI and assign it the value 3.14159. Then, declare a decimal variable radius r with a value 200 and calculate the area of a circle using the formula area = PI * radius * radius and debug the area variable output.
  5. Declare two integer variables x and y with values 1600, 200 and perform the following operations.  Add x and y and store it in a variable named addition, Subtract y from x and store it in a variable named  subtraction,  Multiply x and y and store it in a variable named multiplication, Divide x by y and store it in a variable named division.                                Calculate the remainder when x is divided by y and store it in a variable named remainder.
  6. Initialize an integer variable count to 5. Perform the below operations and debug the final value of the count. Increment count by 1, Reduce count by 2, Increase count by 10,  Reduce count by 3.
  7. Declare an integer variable total and initialize it to 15. Use Athematic operators to perform the following and debug the final value of the count. Add 5 to total, Subtract 3 from total, Multiply total by 4. Divide total by 2.
  8. Initialize some random integer variable number to 27. Calculate when number is divided by 4 and store it into a new variable named remainder and debug the remainder.
  9. Declare integer variables a, b, and c. Assign values 5, 3, and 2, respectively. Calculate the result of the expression result = a + b * c and debug it, Calculate the result of another expression result2 = (a + b) * c and debug it.
  10. Declare two string variables firstName with a value Stephen and lastName with a value George and Concatenate the two strings to form a full name with a space between first name and last name and store it into a new string variable named fullname and debug it.

Trailhead Exercise: 

Apex Basics for Admins : https://trailhead.salesforce.com/content/learn/modules/apex-basics-for-admins 

0% Complete