I'm gonna come out straight, this is a homework assignment. I almost got it done, but there is one main issue keeping me from compiling and finishing this. I have two classes. One is a tester (main method) and the other class containing the constructor with the other methods. In a for loop in the tester class, I have a line of code that is written out as:
distance[index] = fillup[index].calcDistance();
I get the error on this line and and the IDE is pointing to the parentheses at the end of calcDistance saying Incompatible Types.
In the other class with the constructor I have a method written as:
andpublic void calcDistance (){ myDist = myEndMiles - myStartMiles; }
The error explains that it detects a different type, where it expects something but some other type is placed there instead. Well I maintained the int type and there are no arguments so I don't really see what the problem is. I even have it written out similar to the example program. I have all the variables declared and everything. If you need more code to see let me know.public int getDistance (){ return myDist; }