My code seems to be functioning properly but I can't seem to be able to make the terminating part pop up along with "-1" in the program when I input it. It keeps popping up with a null value after the "$" sign at the end.
Loan range: $10000 - $100000]
Enter loan amount (-1 to quit): $
As I said earlier, I've tried doing everything but I can't seem to make terminating part pop up with "-1".
The problem is that if loanamt is -1, then loanamt < 10000 is true, so it prints Invalid load amount. At the bottom of the loop it decides to terminate.
One way to handle this is to change the loop to a while loop and check for -1 when you read the number.