Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 98 discussion

Actual exam question from Salesforce's CRT-450
Question #: 98
Topic #: 1
[All CRT-450 Questions]

The Account object has a custom Percent field, Rating, defined with a length of 2 with 0 decimal places. An Account record has the value of 50% in its Rating field and is processed in the Apex code below after being retrieved from the database with SOQL.

What is the value of acctScore after this code executes?

  • A. 5
  • B. 50
  • C. 500
  • D. 5000
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
questmajor
Highly Voted 2 years, 8 months ago
Correct. Percentage in apex is translated as numbers, so 50% is 50 in apex
upvoted 7 times
...
Ke_James0302
Most Recent 2 weeks, 2 days ago
Selected Answer: D
D Correct
upvoted 1 times
...
Tristelo
8 months, 4 weeks ago
Selected Answer: D
I tried this on an opp with a percent field of 100%. Result was 10000. Opportunity opp = [SELECT Id, Probability FROM Opportunity WHERE Id='[INSERT ID HERE]' LIMIT 1]; Decimal result = opp.Probability * 100; System.debug(result);
upvoted 3 times
...
Nikospa11
9 months, 2 weeks ago
Selected Answer: D
D 100%. I tested it
upvoted 1 times
...
briccoli11
1 year, 4 months ago
Selected Answer: B
Percents are also their own data type—a number with a percent sign attached. A Percent is stored as a number divided by 100, meaning that 100% is represented as 1, 90% as 0.9, and so on. Source: https://trailhead.salesforce.com/content/learn/modules/advanced_formulas/numbers_formulas
upvoted 2 times
...
BaptisteBerard
1 year, 4 months ago
Can we get a source for the answer D?
upvoted 1 times
...
smoota
1 year, 9 months ago
Selected Answer: B
https://trailhead.salesforce.com/content/learn/modules/advanced_formulas/numbers_formulas Percents are also their own data type—a number with a percent sign attached. A Percent is stored as a number divided by 100, meaning that 100% is represented as 1, 90% as 0.9, and so on.
upvoted 2 times
KAALISHAN
1 year, 9 months ago
Not right, answer is D. When a percentage field is retrieved, it retrieves just the number part. So 50% will show as 50, which when multiplied by 100 will be 5000.
upvoted 5 times
...
Nand072
1 year, 2 months ago
This is wrong because in Formula, it behaves like an actual percentage but in Apex, it behave like a number, without the "%"
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...