Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2.2 Question 2 - Implement Java Interface (assesses the ET2 CEAB indicator) 1. In the same project file, create a new package and named Question
2.2 Question 2 - Implement Java Interface (assesses the ET2 CEAB indicator) 1. In the same project file, create a new package and named Question 2. > 2. In this package, create a new generic type abstract class as shown in Figure 3. Wheel 3. This class maintain the value of the wheel stored in the field value. You need -value: T to implement the body of the methods setValue) and getValue, and define the method reser) and isRolledOvert) as abstract methods. *setValue(value: T):void +getValue(): T 4. The purpose of resi) method is to set the value field to the minimum value +reset():void +isRolledOver().Boolean of the wheel, and the purpose of isRolledOverl) method is to return whether the last wheel step caused a rollover. Figure 3 5. In the same Question2 package, create a new class and name it Integer Wheel as shown in Figure 4. This class should provide body implementation for the rest) and isRolledOvert) methods in addition to a full implementation to the interface Rollable. 6. The constructor with one argument will initialize the min Value by 0, and the max Value by max, and set the wheel value to max. The constructor with two arguments will initialize the minValue by min and the max Value by max, and set the wheel value to min. 7. This class records a non-negative count value that is between a minimum and a maximum value. Rolling up the wheel beyond its maximum will roll it over to the minimum value. Rolling down the wheel below its minimum will roll it over to the maximum value. 8. Write a new class named Integer Wheel Counter that implements the Counter Display interface and references the Integer Whee/class, see Figure 5 above. This class maintains a collection of three wheels of type Integer Wheel 9. Implement the toString() method to return a string that represent the Integer Wheel Counter object as shown in the given video Clock Demo.mp4. Abdelkader Ouda page 2 Winter 2021 SE2203b: Software Design Assignment 1 > Wheel -value: T > Rollable > Counter Display treset():void +shuffle():void +increase():void +decrease():void 4 +setValue(value: T):void +getValue(): T +reset() void +isRolledOveri).Boolean +rollUp() void +rollDown(); void A Integer WheelCounter - integer Wheel Integer Wheels - nooWheels: int Integer Wheel - minValue: int - maxValue: int + IntegerWheelCounter Integer Wheel wheelThree, Integer Wheel wheelTwo, Integer Wheel wheelOne) + IntegerWheel(max:int) + Integer Wheel(min:int, max: int) + getMin(); int + getMax(): int + toString(): String Figure 4 Figure 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started