1. Write a Java value-returning method, isDivisibleBy, that takes two integer pa
ID: 3609700 • Letter: 1
Question
1. Write a Java value-returning method, isDivisibleBy, that takestwo integer parameters. The methodreturns the value true if the first parameter is evenly divisibleby the second parameter, otherwise the method returns false. Give an example of how to call the method.
1. Write a Java class, Car, that hasattributes for make, model, color, year, and vin number. Provide a default constructor that sets all the attributes to emptystrings, and a constructor the sets all the attributes to thevalues passed in the constructor. Provide get and set methodsfor each of the attributes, and a toString method that prints allthe attributes of the object.
2. Write the Java statements to instantiate two objects of typeCar from the previous question. One objectshould be instantiated using the default constructor and the otherwith the overloaded constructor. Then use the set methods onthe object instantiated using the default constructor.
3. Write the necessary Java code to determine if the twoCar objects created in the previous question areequal. (Equal meaning that the objects data are equal)
Explanation / Answer
1. Write a Java value-returning method, isDivisibleBy, that takes two integer pa
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.