Question: Help needed in java question ! Thanx Part A) Implement the upgrade method in the Car class, which upgrades the features depending upon the money

Help needed in java question ! Thanx

Help needed in java question ! Thanx Part A) Implement the upgrademethod in the Car class, which upgrades the features depending upon themoney available. The upgrades available are AC, Leather Seats, Back Wipers andFog Lights. Remember we cannot install Back Wipers without Leather Seats and

Part A) Implement the upgrade method in the Car class, which upgrades the features depending upon the money available. The upgrades available are AC, Leather Seats, Back Wipers and Fog Lights. Remember we cannot install Back Wipers without Leather Seats and Fog Lights without AC, whereas Leather Seats and AC can be installed without Back Wiper and Fog Lights Initial Code is given below, you have to implement only upgrade method You will pass first your ID to constructor, which will decide the AC, Leather Seats, Back Wipers, and Fog Lights Price on percentage bases. Second, you will call upgrade() method to pass money (you have) and up-gradation you want. public class myProj { public static void main(String[] args) { car mycar = new car(777); //student id is an integer value mycar.upGrade(700, true, false, false,false); class car int AC; int Leather Seats; int back Wipers; int fog Lights; car(int student_id) { AC = student_id%30; //AC price is 30 percent of student id Leather Seats = student id%25; //LeatherSeats price is 25 percent of student id back Wipers = student_id%10; //backWipers price is 10 percent of student id fogLights = student_id%35; //fogLights price is 35 percent of student id } void upGrade(int amount, boolean AC, boolean LeatherSeats, boolean backWipers, boolean fogLights ) { // implement Code here } upGrade method arguments This method will pass the 5 parameters, first (int) is amount, you want to spend for up-gradation second false if no AC up-gradation required, true if AC up-gradation required third false if no Leather Seats up-gradation required, true if LeatherSheats up-gradation required . fourth false if no backWipers up-gradation required, true if backWipers up-gradation required fifth false if no fogLights up-gradation required, true if fogLights up-gradation required Possible Output Examples Only AC installed AC and Leather Seats Installed AC, Leather Seats, Back Wiper and Fog Lights are Installed You cannot install Back Wiper without Leather Seats You cannot install Fog Lights without AC . Part B) Change/fix the following code to show a circle at bottom-center of the Pane with black border and filled with green color. Remember, you must include relevant import statements as well to run the program successfully. public class ABC extends Application { @Override public void start(Stage primaryStage) throws Exception { Circle circle = new Circle(); circle.setRadius(50); Pane pane = new Pane(); pane.getChildren().add(circle); Scene scene = new Scene(pane, 200, 200); primaryStage.setTitle("ShowCircle"); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { Application.launch(args); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!