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