Check Heritage and Print Output

Finally we need to print out the results by checking if the heritage is enough to live without working or not. If heritage is positive number , we print: „Yes! He will live a carefree life and will have {N} dollars left.“, and if is negative number : „He will need {М} dollars to survive.“. Do not forget to format the sum to the second decimal point.

Hint: Consider using the Math.Abs(…) function when printing the output, if the heritage is not enough.

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/511#2.

results matching ""

    No results matching ""