After calculating the relevant prices and the total amount for the stay, now let's prepare the formatted result. Before that, we should store it in our output parameters -
In order to calculate the output parameters, we will use the
decimal.Round(Decimal, Int32) method .
This method rounds the decimal number up to a specified number of characters after the decimal point. To do that, we pass to the method
apartamentPrice) and integer (
int) data types. In our case, we will round the decimal number up to two digits after the decimal point.
Finally, what remains is to print the calculated results in the console.
Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/509#4.