You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Explanation: The fraction -4/7 is a proper fraction because the absolute value of the numerator (4) is less than the denominator (7). The function should return true.
55
48
constnegativeFraction=isProperFraction(-4,7);
56
49
// ====> complete with your assertion
57
-
assertEquals(negativeFraction,true);
58
50
59
51
// Equal Numerator and Denominator check:
60
52
// Input: numerator = 3, denominator = 3
61
53
// target output: false
62
54
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
63
55
constequalFraction=isProperFraction(3,3);
64
56
// ====> complete with your assertion
65
-
assertEquals(equalFraction,false);
66
57
67
58
// Stretch:
68
59
// What other scenarios could you test for?
69
-
70
-
71
-
// Zero Numerator check:
72
-
// Input: numerator = 0, denominator = 5
73
-
// target output: true
74
-
// Explanation: The fraction 0/5 is a proper fraction because the numerator (0) is less than the denominator (5). The function should return true.
75
-
constzeroNumerator=isProperFraction(0,5);
76
-
assertEquals(zeroNumerator,true);
77
-
78
-
// Negative Denominator check:
79
-
// Input: numerator = 2, denominator = -3
80
-
// target output: false
81
-
// Explanation: The fraction 2/-3 is not a proper fraction because the denominator is negative. The function should return false.
0 commit comments