Question: Pls help to write it in java, thank you! Ahmad is learning the divisibility rules that can test whether one integer can be exactly divided

 Pls help to write it in java, thank you! Ahmad is

learning the divisibility rules that can test whether one integer can beexactly divided by another. Write a program to proof the divisibility rulesfor the number eleven. Design an abstract class named Eleven that consists

of the following members: A field for the integer array without size.A field that used to store file name. A constructor that contains Pls help to write it in java, thank you!

Ahmad is learning the divisibility rules that can test whether one integer can be exactly divided by another. Write a program to proof the divisibility rules for the number eleven. Design an abstract class named Eleven that consists of the following members: A field for the integer array without size. A field that used to store file name. A constructor that contains one argument file name. The constructor will read all the integers from the binary file and save the integer values in the array. An abstract method without argument named divide. The method returns String value. Design a DivideF1 class that derived from the Eleven class. The DivideF1 class has the following members: A constructor that pass the file name to base class. A divide method that checks whether the integer in the array can be divided by 11 using the formula below. The method will return the steps of solution and the result. An integer is divisible by 11 if, [xmodulus 11 is equal to 0, x is the difference of the sum of all odd digits and sum of all even digits, Example 190817: x = (9+8+7) - (1+0+1) = 22, [x] = 22, |x| modulus 11 = 0, 190817 is divisible by 11 You are not allowed to convert the integer into String, you need to use formula to get each odd and even digit. Design a DivideF2 class that derived from the Eleven class. The DivideF2 class has the following members: A constructor that pass the file name to base class. A divide method that check whether the integer in the array can be divided by 11 using the formula below. The method will return the steps of solution and the result. An integer is divisible by 11 if x modulus 11 = 0, x is less than 100 and is the subtraction of the last digit from a number made by the other digits, Example 190817: 19081 - 7*1 = 19074, 1907 - 4*1 = 1903, 190 - 3*1 = 187, 18 - 7*1 = 11, x=11 x modulus 11 = 0 190817 is divisible by 11 Write a tester class using the following sample code. public static void main(String[] args) { DivideF1 a = new DivideF1("data.dat"); DivideF2 b = new DivideF2("data.dat"); display(a); display(b); } 22 modulus 11 = 0, 190817 is divisin 1)! = 22 public static void display(Eleven el) { System.out.println(el.divide()); } Contoh output: Sample output: Divisibility Rule Formula 1 10 10 modulus li is not equal to 0, 802 is not divisible by 11 190817 IX-1 (9+8+ by 11 50346340 x 60 +2+3+,6 + 4) = 11 11 modulus il = 0, $0346340 is divisible by il coutput omitted Divisibility Rule (Formula 2) 802, 80 - 2*1 = 78, X78 78 modulus ii is not equal to 0, 802 is not divisible by 11 190817 : 19081 - 7* 1- 19074. 1907 - 4,1 = 1903, 190 - 3 * 1 = 187, 18 - 7 * 1 = 11, x = 11 11 modulus 11 = 0, 190817 is divisible by 11 50346340, : 5034634 - 0 1 = 5034634, 503463.- 4 * 1 = 503459, 50345 - 9 + 1 = 50336, 5033 - 6 + 1 = 5027, 502 - 7*1 = 495, 49 - 5*1 = 44, * = 44 44 modulus 11 = 0, 50346340 is divisible by 11 coutput omitted

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!