vendredi 18 octobre 2019

Is there anyway to create an if statement to print an output that says by how many kilos i have exceeded?

Also is it possible for the for the kilos to be measured by exactly 0.5kg? For example the maximum weight of an object is 20kg however I input an object that is 22.5 kg. So the output would be "You have exceeded by 2.5 kg.". Also is it possible vice versa( Input=15 kg, Output=You have not achieved the minimum weight. You are short of x kg ). And is it also possible for the distance? Example the minimum distance is 10 km and the maximum distance is 2000 km but I input x km which is either less than 10 km or more than 2000 km. The output would be "Your distance is less/more by y km."


This is the code https://imgur.com/a/VsCAZMX

Aucun commentaire:

Enregistrer un commentaire