Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public with sharing class CommentingOnCodeExercise {
  2.  
  3. /**
  4. * Your Assignment is to add comments describing what is being done in the methods below.
  5. * Call out the concepts you learned in your readings and in class.
  6. */
  7.  
  8. public static void cartValues() {
  9.  
  10. Integer minimumCartValue = 50;
  11.  
  12. Integer itemA = 10;
  13. Integer itemB = 20;
  14. Integer itemC = 45;
  15. //assigning values to the three items
  16. Integer cartValue = itemA + itemB;
  17. //adding items A and B and assigning a value to the cartValue integer
  18. Boolean cartMinimumMet = cartValue >= minimumCartValue;
  19. //checking if cartValue is greater or equal to the minimumCartValue total
  20. System.debug('Have we reached the minimum: ' + cartMinimumMet);
  21. //Print if the minimum value has been reached.
  22. cartValue = cartValue + itemC;
  23. //add item C to the cartvalue
  24. cartMinimumMet = cartValue >= minimumCartValue;
  25. //is the cart cvalue greater or equal to the minimum cart value?
  26. System.debug('How about now? : ' + cartMinimumMet);
  27. //Print if the cart minimum value has been met?
  28. }
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement