Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util. * ; / * * * * @author Alexandra Vaschillo * / public class TwoMethodsA 0 3 { / * * * Method
import java.util.;
@author Alexandra Vaschillo
public class TwoMethodsA
Method finds and returns the largest digit in a given number
@param num the number to analyze
@return the largest digit
public static int getLargestDigitint num
return ;
Method calculates and returns the sum of fractions aa
@param a the limit of the fraction pattern
@return the sum of fractions; returns if the parameter value is less than
public static double fractionSumint n
return ;
A set of tests for getLagrestDigit method.
public static void testGetLargestDigit
Test
ifgetLargestDigit && getLargestDigit && getLargestDigit System.out.printlnTest for getLargestDigit PASSED";
else System.out.printlnTest for getLargestDigit Failed";
Test
ifgetLargestDigit && getLargestDigit && getLargestDigit && getLargestDigit System.out.printlnTest for getLargestDigit PASSED";
else System.out.printlnTest for getLargestDigit Failed";
A set of tests for testFractionSum method
public static void testFractionSum
Test
iffractionSum && fractionSum System.out.printlnTest for fractionSum PASSED";
else System.out.printlnTest for fractionSum Failed";
Test
iffractionSum System.out.printlnTest for fractionSum PASSED";
else System.out.printlnTest for fractionSum Failed";
Test
ifMathroundfractionSum System.out.printlnTest for fractionSum PASSED";
else System.out.printlnTest for fractionSum Failed";
Test
ifMathroundfractionSum System.out.printlnTest for fractionSum PASSED";
else System.out.printlnTest for fractionSum Failed";
Test
ifMathroundfractionSum System.out.printlnTest for fractionSum PASSED";
else System.out.printlnTest for fractionSum Failed";
@param args the command line arguments
public static void mainString args
testGetLargestDigit;
testFractionSum;
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