Question: Alex writes a simple program to calculate the final cost of a purchase: cost 0 . 7 tax 0 . 1 final cost + tax
Alex writes a simple program to calculate the final cost of a purchase:
cost
tax
final cost tax
They're surprised to see that final stores the value instead of
What is the best explanation for that result?
Choose answer:
Choose answer:
Choice A An integer overflow error occurred.
A
An integer overflow error occurred.
Choice B The result was too large of a number to be stored in floatingpoint representation.
B
The result was too large of a number to be stored in floatingpoint representation.
Choice C The arithmetic operations on floatingpoint numbers resulted in a roundoff error.
C
The arithmetic operations on floatingpoint numbers resulted in a roundoff error.
Choice D The computer stored the result with floatingpoint representation instead of integer representation.
D
The computer stored the result with floatingpoint representation instead of integer representation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
