Key - Mouse (Logic)

Published by Mubashir Hassan in

A keyboard and a mouse cost in total x, knowing that the keyboard costs y more than the mouse, calculate the price of the mouse. Round the price of the mouse.

Examples

KM({"Total": "10.00$", "Difference": "0.40$", "Mouse": "?"})
➞ {"Total": "10.00$", "Difference":"0.40$", "Mouse": "4.8$"}

KM({"Total": "90.00$", "Difference": "5.40$", "Mouse": "?"})
➞ {"Total": "90.00$", "Difference": "5.40$", "Mouse": "42.3$"}

KM({"Total": "1.30$", "Difference": "0.80$", "Mouse": "?"})
➞ {"Total": "1.30$", "Difference": "0.80$", "Mouse": "0.25$"}

Notes

If you get stuck, check the Resources tab.

Watch a quick demo on how Edabit works.