Created
September 13, 2017 20:41
-
-
Save pritaunk/deb8d670a947d08b723e9bd4eb4fdf39 to your computer and use it in GitHub Desktop.
Commenting on code week 1
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 () { | |
// a variable called minimumCartValue has been declared and assigned a value of 50. | |
integer minimumCartValue = 50; | |
//declaring variables itemA, itemB and itemC and assigning values respectively. | |
integer itemA = 10; | |
integer itemB = 20; | |
integer itemC = 45; | |
//adding up the values for the variable 'cartValue'. in this case it's 30. | |
integer cartValue = itemA + itemB; | |
//declaire boolean with variable as cartminimummet and then compare if the cartvalue is greater than or equal to the min.cart value. | |
Boolean cartMinimumMet = cartValue >= minimumCartValue; | |
//this is a print debug log to check if the above boolean value is true or false. | |
system.debug('Have we reached the minimum: '+cartMinimumMet); | |
//re assigning an additional value to the existing cart value?. | |
cartValue = cartValue + itemC; | |
//checking if the cartvalue assigned is greater than or equal to the min.cart value?. | |
cartMinimumMet = cartValue >= minimumCartValue; | |
//this is a print debug log to check if the boolean value is now true or false. | |
system.debug('How about now? : '+cartMinimumMet); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment