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:

Galen
2 months ago
I'm stumped. Maybe I should just become an electrician instead - no complicated billing rules to worry about!
upvoted 0 times
...
Cristy
2 months ago
Option C looks like it would work, but it's a bit too open-ended. I prefer the more controlled approach of Option B to keep the bill calculation secure.
upvoted 0 times
Billye
11 days ago
I see your point about Option C being open-ended. Option B does seem like a better choice for maintaining security in the bill calculation.
upvoted 0 times
...
Tori
16 days ago
I think Option A might be too restrictive, so I also lean towards Option B for a more controlled approach.
upvoted 0 times
...
Gary
24 days ago
I agree, Option B seems like the safer choice to ensure the bill calculation remains secure.
upvoted 0 times
...
...
Chantell
2 months ago
Haha, good one! Option A would be like letting the customer be the accountant. Might as well just give them the keys to the vault!
upvoted 0 times
Joana
1 months ago
Option A is a no-go. We need to keep the bill in check, no customer tampering allowed.
upvoted 0 times
...
Margery
1 months ago
I agree, giving customers control over the bill is a bad idea. Option A is definitely out.
upvoted 0 times
...
Destiny
2 months ago
Yeah, Option A sounds risky. We can't let customers mess with the bill.
upvoted 0 times
...
...
Lelia
2 months 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
2 months 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
Tish
20 days ago
Choosing Option B would align with the requirement to prevent customers from decreasing the bill value.
upvoted 0 times
...
Leatha
1 months ago
I think Option C and D are not as suitable for maintaining the integrity of the bill variable.
upvoted 0 times
...
Shelton
2 months ago
Option A might not provide the necessary protection against customers tampering with the bill value.
upvoted 0 times
...
Ettie
2 months ago
I agree, Option B would ensure that the bill is always calculated correctly based on electricity usage.
upvoted 0 times
...
...
Beata
3 months ago
That's a good point, Ashlyn. Option C does offer better protection against tampering. I see your point now.
upvoted 0 times
...
Ashlyn
3 months 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
3 months 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