I've been working on my project for about 15 hours straight and I ran out of ideas and am in desperate need of some help. I have looked at tutorials and books, but i cannot figure it out.
My main problem is that i cannot understand/calculate how i can use an overload method to choose between an int or a double. To explain I'm trying to get my program to use user input to convert the value to either int to a double (or vice-versa) and store the result to show the correct answers.
Instead of just leaving it as double I'm trying to get the variation for each possibility.
The reason I'm trying to do so is as follows (i know the code doesn't need it but the assignment requires i do so in this way but I keep hitting dead ends) :
Here’s where the overloading comes in: some applications will define the amount as an int, and others will define it as a double. Therefore, you need to write two overloaded versions of this method:
Get user input only once. If you convert the input value for the amount loaned to an int and store it in an int variable, you can then convert the value of this int to a double and store the result of this conversion in a double variable. The use of cast operators to either convert int values to double or double values to int.