Firstly we have to create an object of name “ MPC__c “. This apex trigger takes two fields 1. Median_Output__c , 2. Values_to_calculate_Median__c . A median value is the value at the center of a sorted list. To median we need to sort the list in ascending or descending order. For Example take the list of 3, 5, 2, 7, 3 as our input list. To find out median, first we re-order it as 2, 3, 3, 5, 7. and we find that at location 3 ((5+1)/2) is 3. So the value of median in this list is 3. Algorithm Continue reading. . .
Firstly we have to create an object of name “ MPC__c “. This apex trigger takes two fields 1. Factorial__c , 2. Output_of_the_Factorial__c . An armstrong number is a number which equal to the sum of the cubes of its individual digits. For example, 153 is an armstrong number as − 370 = (3)3 + (7)3 + (0)3 370 = 27 + 343 + 0 370 = 370 Algorithm Continue reading. . .
Firstly we have to create an object of name “ MPC__c “. This trigger takes two fields 1. Prime_Number__c , 2. Output_of_the_prime_number__c . Any whole number which is greater than 1 and has only two factors that is 1 and the number itself, is called a prime number. Other than these two number it has no positive divisor. For example − 5 = 1 × 5 Few prime number are − 1, 2, 3, 5 , 7, 11 etc. Algorithm Continue reading. . .
Firstly we have to create an object of name " Date_OF_Birth_Calculat__c ". Add two additional Custom fields Fields : Birth_date__c , Present_Age__c The approach used below is as follows − Continue reading. . .
Firstly we have to create an object of name “ MPC__c “. This apex trigger takes two fields 1. No_To_Find_Average__c , 2. Output_Of_Average__c . An average of set of numbers is their sum divided by their quantity. It can be defined as average = sum of all values / number of values Here we shall learn how to programmatically calculate average. Algorithm Continue reading. . .
Firstly we have to create an object of name “ MPC__c “. This apex trigger takes two fields 1. Mean_Output__c , 2. Values_to_calculate_mean__c . Mean is an average value of given set of numbers. It is calculated similar to that of average value. Adding all given number together and then dividing them by the total number of values produces mean . For Example − Mean of 3, 5, 2, 7, 3 is (3 + 5 + 2 + 7 + 3) / 5 = 4 . Algorithm Continue reading. . .
Firstly we have to create an object of name “ MPC__c “. This Apex trigger takes two fields 1. Fibonacci_Number__c , 2.Output_of_the_fibonacci_number__c . Fibonacci Series generates subsequent number by adding two previous numbers. Fibonacci series starts from two numbers − F 0 & F 1 . The initial values of F 0 & F 1 can be taken 0, 1 or 1, 1 respectively. Fibonacci series satisfies the following conditions − Fn = Fn-1 + Fn-2 So a Fibonacci series can look like this − F 8 = 0 1 1 2 3 5 8 13 or, this − F 8 = 1 1 2 3 5 8 13 21 Algorithm Continue reading. . .
In this example, you will learn to create a simple calculator from a apex trigger in salesforce development. Firstly we have to create an object of name " Calculater__c ". This apex trigger takes an picklist arithmetic operator " operator__c " +, -, *, / and two fields operands " Value_1__c " and " Value_2__c " from the user. Then, it performs the calculation on the two operands depending upon the operator entered by the user. Code : Continue reading. . .
Comments
Post a Comment