Question: JAVA, please include test run A huge boulder fell in the night on a small village in western France blocking the only one road axis

JAVA, please include test run

A huge boulder fell in the night on a small village in western France blocking the only one road axis leaving the village. It is decided to form a team of villagers to try to move the rock. Q 2.1 Create the class Villager which contains the following private attributes - weight in kg of the villager (whole number) - sick: fields indicating whether the villager is sick or not and the following attributes - a private method allowing to fix randomly a weight between 50 and 150 kg (150 excluded) - a private method which randomly assigns the sick variable to true in 20% of cases and false otherwise. - a public default constructor that initializes a villager using both methods to initialize the other values - add public accessors to the three attributes as well as a toString () method returning a chain of the format: villager: weight: 95 kg, sick: no. 2 In a new TestVillage class, add a main method, which creates an instance of the classifies Villager and displays the data of a villager. 3 Create a Village class containing a table attribute of type Villager and the weight of the rock. A builder having as a parameter the number of villagers available to lift the rock

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!