Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public with sharing class CommentingOnCodeExercise {
- /**
- * Your Assignment is to add comments describing what is being done in the methods below.
- * Call out the concepts you learned in your readings and in class.
- */
- public static void cartValues() {
- Integer minimumCartValue = 50;
- Integer itemA = 10;
- Integer itemB = 20;
- Integer itemC = 45;
- //assigning values to the three items
- Integer cartValue = itemA + itemB;
- //adding items A and B and assigning a value to the cartValue integer
- Boolean cartMinimumMet = cartValue >= minimumCartValue;
- //checking if cartValue is greater or equal to the minimumCartValue total
- System.debug('Have we reached the minimum: ' + cartMinimumMet);
- //Print if the minimum value has been reached.
- cartValue = cartValue + itemC;
- //add item C to the cartvalue
- cartMinimumMet = cartValue >= minimumCartValue;
- //is the cart cvalue greater or equal to the minimum cart value?
- System.debug('How about now? : ' + cartMinimumMet);
- //Print if the cart minimum value has been met?
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement