How do I fix the error in the first image based on the parameters in the second
ID: 3748779 • Letter: H
Question
How do I fix the error in the first image based on the parameters in the second image?
File Edit Source Refactor Navigate Search Preject Run WindDw Help Quick Access . 1 public class Main { Comp1900 Lab 1 .Cornp1900-Lab 11 Comp1 Lab2 P Comp190 Lab 2 H public static void mein(String[] args) { final int roadSrrvicrtknth 6; ini.ste(1) mini.steer(1); mini.steer(-); nini.arrelrrate(0) mini.aucelerate(2); ini.steer(ze); nini.arrelrrate-15); mini.aucelerate(5); mini.steer(); ini.arrelrrate(-10); Comp1900 Lab4 Comp1900 Lab4H Cunp1900 Lab 511 Comp1900ab5 H eComp1900 Labb Comply00. Lab Systen.out.println(nini.tostring) CompS 2150 Assig CompSi 2150Assg 21 RE System Librar22 (de,aull pecka! DVelicle.java intable Smart Insert 22:1 :15 PM O Type here to searchExplanation / Answer
The ChevyVolt constructor takes many parameter. (Notice the constructor at line 5 in ChevyVolt.java).
When you are creating the object, you are just passing a single value of roadServiceMonth, while the constructor require lot more parameters, so you need to pass them all in the order mentioned in ChevyVolt file and you will be able to create the object.
One sample will be:
ChevyVolt ch = new ChevyVolt("MyName", "Large Engine", 20, 1, 4, 4, 5, true, 5);
There are random values, that i have given to show you. You should pass meaningful values as per your use. Thanks!
please upvote if it helps.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.