Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
We are using here a powerful strategy for designing programs: [...] We haven't yet said how a rational number is represented, or how the functions numer , denom , and rational should be implemented. Even so, if we did define these three functions, we could then add, multiply, print, and test equality of rational numbers:
Answer
wishful thinking.

Question
We are using here a powerful strategy for designing programs: [...] We haven't yet said how a rational number is represented, or how the functions numer , denom , and rational should be implemented. Even so, if we did define these three functions, we could then add, multiply, print, and test equality of rational numbers:
Answer
?

Question
We are using here a powerful strategy for designing programs: [...] We haven't yet said how a rational number is represented, or how the functions numer , denom , and rational should be implemented. Even so, if we did define these three functions, we could then add, multiply, print, and test equality of rational numbers:
Answer
wishful thinking.
If you want to change selection, open original toplevel document below and click on "Move attachment"

Parent (intermediate) annotation

Open it
We are using here a powerful strategy for designing programs: wishful thinking. We haven't yet said how a rational number is represented, or how the functions numer , denom , and rational should be implemented. Even so, if we did define these three functions, we co

Original toplevel document

2.2 Data Abstraction
s the following three functions: rational(n, d) returns the rational number with numerator n and denominator d . numer(x) returns the numerator of the rational number x . denom(x) returns the denominator of the rational number x . <span>We are using here a powerful strategy for designing programs: wishful thinking. We haven't yet said how a rational number is represented, or how the functions numer , denom , and rational should be implemented. Even so, if we did define these three functions, we could then add, multiply, print, and test equality of rational numbers: >>> def add_rationals(x, y): nx, dx = numer(x), denom(x) ny, dy = numer(y), denom(y) return rational(nx * dy + ny * dx, dx * dy) >>> def

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.