Answer:
For you first question about the defined function program:
if ( v ≤ 250 ) {
set p to (5 + v*.02)
}
elseif ( 250 ≤ v ≤ 800 ) {
set p to (5 + 2500 + (v - 250)*.02)
}
else {
set p to (5 + 28000 + (v - 800)*.1)
}
This function will first check if the user has used how many units and decide which category that user falls into.
Then, it uses that information to execute a command to calculate how much money that user should pay for the electricity bill, factoring in the extra demands from the question.
For your second question:
(5 + 2500 + (700 - 250)*.02)
= (3000 + 450*.02)
= (3000 + 9)
= 3009
The customer should have paid 3009 dollars.
Explanation:
Hope this helped!