Question: 19 The Bayes Theorem is given by P(B) P (AB) P( BA) =- P(B) P(AB) k=1,2,..., The probability P(BR) is called prior probability Marks Work

 19 The Bayes Theorem is given by P(B) P (AB) P(
BA) =- P(B) P(AB) k=1,2,..., The probability P(BR) is called prior probability

19 The Bayes Theorem is given by P(B) P (AB) P( BA) =- P(B) P(AB) k=1,2,..., The probability P(BR) is called prior probability Marks Work The goal of this work is to read the dimension of two rectangles (length and width) and to compute the distance between them- 1. Create the java project (LabTest yourName ID) with class main named Test.java. In this file, add the class Rectangle. 2. In the Rectangle dass, add two private data members L and w (called dimensions or attributes). /1 /1 3. In the Rectangle class, add a constructor that uses two parameters LL and ww. When this constructor is used to create an object, it initializes the data of this object by LL and ww. 11 4. In the Rectangle class, add also a static method called randDimensions() that creates an object R of Rectangle type, initialize their values L and w by random values between 0.0 and 100.0 and returns the object R. You can use the following statement to generate the random values: double randomNumber = (Math.random() * (max-min+1)) + min; 5. In the Rectangle class, add a method distance() that computes and returns the distance between two rectangles R1 and R2 having the values (L1, w1) and (L2, w2) respectively according to the following equation: d = (L1-L2) + (w1 - w2)2 Use the following methods sart) and pow(). 6. Add the display() method that shows the dimensions of a rectangle using class formatter. This method displays also the distance between the two rectangles. 11 /1 In the method main of the class Test: 6.1. Create an object R1 of the class Rectangle with fixed values LL=17.5 and ww = 21.5 11 /1 6.2. Create an object R2 of the class Rectangle without fixed values. 6.3. Call the randDimensions ) method to initialize R2 with random values. 6.4. Call the display() method to show the dimensions of the rectangles R1 and R2 and the distance between them. /1

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!