Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codefriar/5de5713b168ae0b30a0459e0b5f29d42 to your computer and use it in GitHub Desktop.
Save codefriar/5de5713b168ae0b30a0459e0b5f29d42 to your computer and use it in GitHub Desktop.
Wk 2 HW: Commenting on Code
/**
* ContactTriggerHandler description
* @description this class is responbile for...
* @author Kevin Poorman
* @updated 8/26/19
*/
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.
*/
/**
* ContactTriggerHandler description
* @return Integer - sum of the two paramters
*/
public static integer add(integer one, integer two){
return one + two;
}
/**
* cartValues() - description here...
* @return return void
*/
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