Last active
August 26, 2019 19:12
-
-
Save katelessardrad/153d0875bd1c114a0fe5bdbd8e8a0405 to your computer and use it in GitHub Desktop.
Wk 2 HW: Commenting on Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | |
//Declare the Integer minimumCartValue and assign value equal to 50 | |
Integer minimumCartValue = 50; | |
//Add Integer items to the List and define their value | |
Integer itemA = 10; | |
Integer itemB = 20; | |
Integer itemC = 45; | |
//Declare the Integer cartValue and assign value equal to itemA plus itemB | |
Integer cartValue = itemA + itemB; | |
//Declare a Boolean expression where cartValue is greater or equal to minimumCartValue | |
Boolean cartMinimumMet = cartValue >= minimumCartValue; | |
//Print the debug log to determine if cartMinimum has been met | |
System.debug('Have we reached the minimum: ' + cartMinimumMet); | |
//Add itemC to the cartValue | |
cartValue = cartValue + itemC; | |
//Check cartMinimumMet Boolean statement | |
cartMinimumMet = cartValue >= minimumCartValue; | |
//Print the debug log to determine if cartMinimum has been met now | |
System.debug('How about now? : ' + cartMinimumMet); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment