Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

imageimageimageimage

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

Step: 1

Below are the completed code snippets and some explanations to help you test the classes CoffeeTrack... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Programming questions

Question

Explain the operation of the dividends received deduction.

Answered: 1 week ago