Created
February 14, 2020 02:45
-
-
Save niavesper/6f63c68a586f6cc8b97ed02a7111789e to your computer and use it in GitHub Desktop.
Week_1_Homework_Primitives.cls
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 static void primitivesExercise() { | |
//You do this part! | |
//1. Declare three primitives variables, an Integer, a String and a Decimal | |
Integer numCatPaws; | |
String catName; | |
Decimal numFurnitureDestroyed; | |
//2. Assign values to your three new variables | |
numCatPaws = 4; | |
catName = 'Bandicoot'; | |
numFurnitureDestroyed = 2.5; | |
//3. Print out your variables to the debug log | |
System.debug('My new cat has ' + numCatPaws + ' paws.'); | |
System.debug('Her name is ' + catName + '.'); | |
System.debug('So far, she has destroyed ' + numFurnitureDestroyed + ' pieces of furniture. But I love her anyway!'); | |
//4. Declare an integer variable and assign a value in the same line | |
Integer numFavoriteToys = 3; | |
//5. Print out your integer to the debug log | |
System.debug('Bandicoot has ' + numFavoriteToys + ' favorite toys.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love cats :) Great work creating the variables and assigning them values. Good naming convention. 👍