CHAPTER 19 Heat and the First Law of Thermodynamics 1. 2. The required heat flow is ?Q = mc ?T = (30.0 kg)(4186 J/kg C)(95C 15C) = 1.0 107 J.
We find the temperature from ?Q = mc ?T; 7700 J = (3.0 kg)(4186 J/kg C)(T 10.0C), which gives T = The
CS 61A Project 3 solutions (Part I)
1. Let's say you live in Bowles, which is east of Lewis. (You have to
work a little harder if you live on Southside!)
; We need a place for you to live before we create you.
(define Bowles (instantiate place 'Bowles)
(Note: Although these posted solutions do not include transcripts, the handout required you to provide transcripts showing that your procedures work correctly. One of the things you are supposed to be learning is h
CS 61A Midterm 3 solutions Fall 2009
1. Box and pointer/what will Scheme print?
> (let (ls '(1 2 3 4)
(for-each (lambda (x) (set! x (+ x 1) ls)
Result: (1 2 3 4)
This was a question about understanding the difference between SET!
CS 61A Fall 2009 Midterm 1 solutions
1. What will Scheme print?
(every (lambda (x) (se x x)
(keep (lambda (x) (even? (count x)
'(and your bird can sing)
Answer: (your your bird bird sing sing)
The function used as argument to KEEP selects words with a
CS 61A LAB = 4.55
Week 15 Solutions
(supervisor ?x (Bitdiddle Ben) (job ?x (accounting . ?y) (address ?x (Slumerville . ?y) The dots are needed because (accounting ?y), for example, would match only entries in which there was a single element after the wo
CS61A Week 14 solutions
4.27 Lazy vs. mutation
The first time you type COUNT you get 1; the second time you get 2.
Why? When you say
(define w (id (id 10)
the DEFINE special form handler eval-definition EVALs its second
argument (id (id 10). Given
CS 61A Week 13 Lab Solutions
1. We make two changes: First, change the mapper function so that the
intermediate pairs use the play names as keys. This will result in a
separate reduce instance for each play. Then, we do an ordinary
CS 61A Week 12 Lab Solutions
3. Why doesn't make-procedure call eval?
Because none of the arguments to lambda should be evaluated.
In particular, the expressions that make up the body of the procedure are
not evaluated until the procedure is *invoked*!
Week 11 solutions LAB = 1. The result of (delay .) is of type *promise*. The result of (force (delay .) is of whatever type the "." would be without delay; in this case it's (force (delay (+ 1 27) and that's of type integer. 2. (stream-cdr (stream-cdr (co
CS 61A Project 3 solutions (Part II)
A6a. First the easy parts:
; make a jail-house. Since we give it no neighbors, there will be no
; entrances or exits
(define jail (instantiate place 'sing-sing)
; make a GO-DIRECTLY-TO method
; insert this into the def
CHAPTER 18 Kinetic Theory of Gases 1. (a) The average kinetic energy depends on the temperature: ! mvrms2 = *kT = *(1.38 1023 J/K)(273 K) = 5.65 1021 J. (b) For the total translational kinetic energy we have K = N(! mvrms2) = *nNAkT = *(2.0 mol
CHAPTER 17 Temperature, Thermal Expansion, and the Ideal Gas Law 1. The number of atoms in a mass m is given by N = m/Mmatomic. Because the masses of the two rings are the same, for the ratio we have NAu/NAg = MAg/MAu = 108/197 = 0.548. The num
CS 61A - Week 9 Solutions LAB ASSIGNMENT: 3.12 append vs. append! exp1 is (b); exp2 is (b c d). Append (without the !) makes copies of the two pairs that are part of the list x. (You can tell because it uses cons, which is the constructor function that ge
CS 61A - Week 8 solutions LAB ACTIVITIES: 1. Use a LET to keep both initial and current balance This is the change.
(define (make-account init-amount) (let (BALANCE INIT-AMOUNT) ; (define (withdraw amount) (set! balance (- balance amount) balance) (define
CS 61A Week 7 solutions
1. random number generator object
(define-class (random-generator range)
(instance-vars (count 0)
(set! count (1+ count)
(random range) )
; We don't need to say (method (count) .) because we automatic
CS 61A Week 6 solutions
2.74 (Insatiable Enterprises):
(a) Each division will have a private get-record operation, so each
division's package will look like this:
(define (get-record employee file)