Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-808 Topic 18 Question 112 Discussion

Actual exam question for Oracle's 1Z0-808 exam
Question #: 112
Topic #: 18
[All 1Z0-808 Questions]

Given these two classes:

Any amount of electricity used by a customer (represented by an instance of the Customer class) must contribute to the customer's bill (represented by the member variable bill) through the useElectricity method.

An instance of the Customer class should never be able to tamper with or decrease the value of the member variable bill.

How should you write methods in the ElectricAccount class at line n1 so that the member variable bill is always equal to the value of the member variable kwh multiplied by the member variable rate?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

Lelia
3 days ago
I'm going with Option D. Encapsulating the bill calculation within the ElectricAccount class ensures the integrity of the data and prevents the customer from making unauthorized changes.
upvoted 0 times
...
Craig
4 days ago
Option B seems the most logical choice to enforce the requirement that the customer's bill cannot be tampered with. The method should allow updating the bill based on the electricity usage, but not allow the customer to directly modify the bill value.
upvoted 0 times
...
Beata
15 days ago
That's a good point, Ashlyn. Option C does offer better protection against tampering. I see your point now.
upvoted 0 times
...
Ashlyn
16 days ago
I disagree, I believe the answer is Option C because it provides a more secure way to prevent tampering with the bill variable.
upvoted 0 times
...
Beata
19 days ago
I think the answer is Option A because it seems like the most straightforward way to ensure the bill is always calculated correctly.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77