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.
48
60
constnegativeFraction=isProperFraction(-4,7);
49
-
// ====> complete with your assertion
61
+
assertEquals(negativeFraction,true);
50
62
51
63
// Equal Numerator and Denominator check:
52
64
// Input: numerator = 3, denominator = 3
53
65
// target output: false
54
66
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
55
67
constequalFraction=isProperFraction(3,3);
68
+
assertEquals(equalFraction,false);
56
69
// ====> complete with your assertion
57
70
58
71
// Stretch:
59
72
// What other scenarios could you test for?
73
+
74
+
constnumeratorZero=isProperFraction(0,5);
75
+
assertEquals(numeratorZero,true);
76
+
77
+
constdenominatorrZero=isProperFraction(5,0);
78
+
assertEquals(denominatorrZero,false);
79
+
80
+
// Sprint-3-implement 1-is-proper-fraction.js all assertions and necessary functions added
0 commit comments