The code is still passing the reference to the Scanner object instead of the value read in from the user into the variables: m and l
Note: m and l are poor names for variables that hold important...
Type: Posts; User: Norm
The code is still passing the reference to the Scanner object instead of the value read in from the user into the variables: m and l
Note: m and l are poor names for variables that hold important...
Please copy the full text of the error message and paste it here.
Also post the code where the error happens.
Note: the name: getDesiredValue was only meant as an example. You need to change it...
The Car class needs to have get methods that return the value you want to test.
In the foreach loop, the variable: a has the reference to the Car object.
Note: a is a poor name for a variable...
Look at post#9. It reads the values from the user in the main method into m and l.
It should pass those values to the method as was done in post#3 instead of the 1,2 that was passed.
What does that mean? If the code is designed and written incorrectly, it needs to be changed.
You can use the Scanner class to read that number from the console outside of the printCarsToValueAndLevelOfEquipment method.
Then pass that number to the method as an argument. See your post#3
...
The values to test for should be acquired before the call to the method and then passed as a parameter to the method.
The method should not be asking the questions and getting the responses.
What does "doesn't work" mean?
Is there an error message? Please copy the full text and paste it here.
Executing the statement does not give the desired result. Print out any evidence that shows...
Add a toString method to the Car class that returns the String you want to be shown on that print out.
The Strings shown in that print out are what is returned by the default toString method for the...
Work through the problems one at a time.
Post one of the problems you are having and describe what the code needs to do for that problem.
If your problem is doing a sort, google about how to use...
What problems are you having with designing it?
I see that The comments say what it is supposed to do.
Please post the code in question here on the forum. Be sure to wrap the code in code tags.