This file contains hidden or 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 WeekFiveHomework { | |
public static void soqlPractice() { | |
//1. Below is a SOQL query that should be returning the top 5 Accounts in our org based on Annual Revenue. | |
//Something's not quite right, can you fix the query? | |
List<Account> topFiveAccounts = [SELECT Id, Name, AnnualRevenue FROM Account WHERE AnnualRevenue != 0 ORDER BY AnnualRevenue Desc LIMIT 5]; | |
System.debug('This should be 5: ' + topFiveAccounts.size()); |
This file contains hidden or 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 class ContactSearch { | |
public static List<Contact> searchForContacts(string a1, string a2) { | |
List<Contact> cont = [SELECT Id, FirstName, LastName, MailingPostalCode FROM Contact | |
WHERE LastName =: a1 AND MailingPostalCode =: a2]; | |
return cont; | |
} | |
} |
This file contains hidden or 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 WeekFourHomework { | |
public static void setsReview(){ | |
//Your assignment: Play with Sets! | |
// 1. Create a set of Strings and add at least 5 entries | |
Set<string> myNewSet = new Set<string>(); | |
myNewSet.add('apple'); |
This file contains hidden or 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 WeekOneHomework { | |
public static void primitivesExercise() { | |
//You do this part! | |
//1. Declare three primitives variables, an Integer, a String and a Decimal | |
integer No; | |
string Str; | |
decimal Dec; |
This file contains hidden or 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 integer variable and assign it a value | |
Integer minimumCartValue = 50; |
NewerOlder