0
Hope y'all having a great day... Why is the tax amount showing zero and how can it be corrected... Thanks
2 ответов
+ 2
On line 9
taxAmount = sales * (10 / 100);
The division is happening between 2 integers (10/100), which leads to conversion of answer (0.1) to type integer only (0), making the overall result equal to 0
Simple fix is to convert any one of them to floating point number 👇
https://code.sololearn.com/cuB3Gxf4Sehv/?ref=app
+ 1
Wow... thanks 😀👍