Blame


1 12687dd9 2023-08-04 jrmu ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 12687dd9 2023-08-04 jrmu ;; about the language level of this file in a form that our tools can easily process.
3 12687dd9 2023-08-04 jrmu #reader(lib "htdp-beginner-reader.ss" "lang")((modname 4.4.4) (read-case-sensitive #t) (teachpacks ((lib "convert.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "convert.ss" "teachpack" "htdp")))))
4 12687dd9 2023-08-04 jrmu ;; how-many : number number number -> number
5 12687dd9 2023-08-04 jrmu ;; Determines how many solutions a given quadratic equation has given
6 12687dd9 2023-08-04 jrmu ;; coefficients a, b, and c.
7 12687dd9 2023-08-04 jrmu
8 12687dd9 2023-08-04 jrmu (define (how-many a b c)
9 12687dd9 2023-08-04 jrmu (cond
10 12687dd9 2023-08-04 jrmu [(= a 0) 'degenerate]
11 12687dd9 2023-08-04 jrmu [(> (sqr b) (* 4 a c)) 2]
12 12687dd9 2023-08-04 jrmu [(= (sqr b) (* 4 a c)) 1]
13 12687dd9 2023-08-04 jrmu [(< (sqr b) (* 4 a c)) 0]))