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
57
constnegativeFraction=isProperFraction(-4,7);
58
+
assertEquals(negativeFraction,true);
49
59
// ====> complete with your assertion
50
60
51
61
// Equal Numerator and Denominator check:
52
62
// Input: numerator = 3, denominator = 3
53
63
// target output: false
54
64
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
55
65
constequalFraction=isProperFraction(3,3);
66
+
assertEquals(equalFraction,false);
56
67
// ====> complete with your assertion
57
68
58
69
// Stretch:
59
70
// What other scenarios could you test for?
71
+
72
+
//Both Numerator and Denominator are negative check:
73
+
// Input: numerator = -4, denominator = -3
74
+
// target output: false
75
+
// Explanation:The fraction -4/-3 is not a proper fraction because the absolute value o the numerator is bigger than the absolute value of the denominator
0 commit comments