【发布时间】:2020-08-10 06:15:20
【问题描述】:
我一直得到我的输出:
Exam Avg: 50.#!unspecific
每当我尝试在方案中打印我的程序时。我正在使用两个函数 print 和 secprint 我认为可能会发生错误:
(define (print cnt List)
(if (= cnt 1) (printEmp (car List))
(secprint cnt List )))
(define (secprint cnt List)
(printEmp (car List))
(newline)
(print (- cnt 1) (cdr List)))
Could someone please help with this? I am new to scheme and can't seem to figure out where I am going wrong.
Edit: Other code that might be useful.
(define (avg List)
(cond ((string=? "std" (car (split List)))
(display (/ (examTotals List) 3.0)))
(else 0))
)
【问题讨论】:
-
avg和avg2是什么? -
几乎可以肯定
#!unspecific是打印未指定返回值的方式。我不知道为什么它自己不在一条线上,因为我希望它是newline的返回值。 -
@molbdnilo avg 和 avg2 是我用来获取考试成绩的函数,我可以编辑原件以包含它们
标签: scheme lisp racket mit-scheme