Question: please help me in java. 5. Explain why the following program is giving error at line 4 from class Sum.java and error at lines 5

 please help me in java. 5. Explain why the following program
is giving error at line 4 from class "Sum.java" and error at
lines 5 and 6 from the class "Sum Test.java"? How can weplease help me in java.

5. Explain why the following program is giving error at line 4 from class "Sum.java" and error at lines 5 and 6 from the class "Sum Test.java"? How can we resolve the error? 1 public class Sum 2 private int x; 3 private double y; 4e public display( { 5 System.out.println("X=" + x); 6 System.out.println("Y = "+y); 7. } 8} 1 public class Sum Test { 2e public static void main(String[] args) { 23 // TODO Auto-generated method stub 4 Sum s = new Sum(); 15 s.y = 23.67; 6 s.display(); 7 } } 8} 6. Draw an UML diagram for given problem statement. a. It has three instance variables yearModel of type int, make of type String and speed of type double. b. Provide a constructor that initializes the instance variables. c. Write getter methods for the instance variables of the class. d. Provide a method accelerate, which adds 12 to speed field each time it is called. e. Provide a method brake, which subtracts 10 to speed field each time it is called. [07 Marks] 7. Write the JAVA program by the using the problem statement which is given in Q6. Write a test class name CarTest and perform the following. a. Create an object for the class Car with the following data yearModel = 2020, make = "Ford Explorer" and speed = 10 b. call the method accelerate for 10 times using the loop c. call the method brake for 7 times using the loop. d. Display car information as shown in output. Car Information Model Year = 2020 Car Make = Ford Explorer Speed of the Car = 60.00 KMPH [10 Marks Note: Type the code in the eclipse, copy the executed code and paste it in the space provided

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!