Question: Need help with these questions. Functions defined outside such as BigInteger class, StringBuilder class, methods from Math class (used as Math.(), such as Math.max(), Math.min(),

Need help with these questions. Functions defined outside such as BigIntegerclass,StringBuilderclass, methods fromMathclass (used as Math.(),such asMath.max(), Math.min(), Math.abs() ...) orIntegerclass (used as Integer.(), such asInteger.parseInt()) or Character class (used asCharacter.(), such as Character.isDigit() can't be used. Cheers

Q1.

1 package practicePackage._03_classesObjects.testsAttempts; 2 30 import java.util.ArrayList; 16 17 public class CoffeeTrackerTest{ 18 19 20 22222222mmmmmmm3772214 public CoffeeTracker tracker; public int[] data; publicstatic int score = 0; public static String result = public staticString currentMethodName = null; ArrayList methods Passed = new ArrayList (); @BeforeEach

1 package practicePackage._03_classesObjects.testsAttempts; 2 30 import java.util.ArrayList; 16 17 public class CoffeeTrackerTest { 18 19 20 22222222mmmmmmm3772214 public CoffeeTracker tracker; public int[] data; public static int score = 0; public static String result = public static String currentMethodName = null; ArrayList methods Passed = new ArrayList (); @BeforeEach public void run() { 25 260 28 29 30 } 330 35 36 38 39 400 44 45 data = new int[] {3, 0, 1, 0, 0, 0, 2, 0, 2, 3}; tracker = new CoffeeTracker(data); currentMethodName = null; @Test @Graded(description = "coffeetracker", marks = 1) public void testCoffeeTracker() { } assertArrayEquals(data, tracker.coffeesPerDay); assertNotEquals(data, tracker.coffees PerDay); //the two object should not refer to the same instance currentMethodName = new Throwable().getStackTrace()[0].getMethodName(); @Test @Graded (description = "averagecoffees consumed", marks = 1) public void testAverageCoffees Consumed () { } assertEquals(1.1, tracker.averageCoffees Consumed (), 0.01); currentMethodName = new Throwable().getStackTrace()[0].getMethodName();

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Below are the completed code snippets and some explanations to help you test the classes CoffeeTrack... View full answer

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 Programming Questions!