A. Using addition instead of multiplication for fee calculation
B. Incorrect variable names
C. Missing print statement
D. Gas price should be divided by gas used
Solution
Step 1: Review the code logic
The code adds gas_used and gas_price instead of multiplying them.
Step 2: Understand correct fee calculation
Transaction fee should be gas_used x gas_price, not addition.
Final Answer:
Using addition instead of multiplication for fee calculation -> Option A
Quick Check:
Fee = gas_used x gas_price, not + [OK]
Hint: Fees multiply gas used by gas price, not add [OK]
Common Mistakes:
Adding gas values instead of multiplying
Confusing variable names
Ignoring correct formula
5. A user wants to speed up their transaction by increasing the gas price from 40 gwei to 60 gwei. If the gas used remains 21000, how much more will the user pay in transaction fees compared to before?
hard
A. 600,000 gwei more
B. 1,260,000 gwei more
C. 420,000 gwei more
D. 840,000 gwei more
Solution
Step 1: Calculate original fee
Original fee = 21000 x 40 = 840,000 gwei.
Step 2: Calculate new fee
New fee = 21000 x 60 = 1,260,000 gwei.
Step 3: Find difference
Difference = 1,260,000 - 840,000 = 420,000 gwei more.
Final Answer:
420,000 gwei more -> Option C
Quick Check:
Increase = (60-40)x21000 = 420,000 [OK]
Hint: Subtract old fee from new fee to find extra cost [OK]
Common Mistakes:
Calculating total fee instead of difference
Mixing gas price and gas used
Incorrect multiplication
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.