help please , I will upvote , Java/Eclipse

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

help please , I will upvote , Java/Eclipse

Post by answerhappygod »

help please , I will upvote , Java/Eclipse
Help Please I Will Upvote Java Eclipse 1
Help Please I Will Upvote Java Eclipse 1 (120.99 KiB) Viewed 20 times
Give the value of the variable z at each of the points 1 to 5. Enter -ı if there is an error at that point. For those lines with errors, assume that we remove that line so the other lines will work. class My ClassA { protected double z; 2 4 6 8 public MyClassA() { operate (10.0, 5.0); } public void operate (double x, double y) { z = x + y; } public void set (double x) { z = x; } 10 12 } 14 16 18 20 22 class My Class B extends MyClassA { public void operate (double x, double y) { z = X * yi } public void set (int y) { z = (double) y * y; } public void operate (double x) { super.operate (x, x + 2); } } 26 public class Main2 { public static void main(String[] args) { MyClass B b = new MyClass(); // point i b.operate (2.5, 5.0); //point 2 b.set(2); // point 3 b. set (10.0); // point 4 b.operate(5);//point 5 24 28 30 32 34 } } Enter double or integer values asrequired. Value of MyClassA.z at Point 1 is Value of MyClassA.z at Point 2 is Value of MyClassA.z at Point 3 is Value of MyClassA.z at Point 4 is Value of MyClassA.z at Point 5 is
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply