100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

CPSC110 Psets Solution

Beoordeling
-
Verkocht
-
Pagina's
5
Cijfer
A
Geüpload op
16-11-2025
Geschreven in
2025/2026

This is the correct solution for the pset that you are going to be given as a student who is/will be taking cpsc110.

Instelling
Vak









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Studie
Vak

Documentinformatie

Geüpload op
16 november 2025
Aantal pagina's
5
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

;​; DO NOT PUT ANYTHING PERSONALLY IDENTIFYING BEYOND YOUR CWL IN THIS​
​FILE.​
​;; YOUR CWLs WILL BE SUFFICIENT TO IDENTIFY YOU.​
​;;​
​(require spd/tags)​
​(require 2htdp/image)​

​(@assignment psets/pset-01);Do not edit or remove this tag​


(​ @problem 1)​
​;;​
​;; Write the BSL expression that most clearly represents the following​
​;; arithmetic expression:​
​;;​
​;; 3^2 + 6 * (6 - 10) / 3​
​;;​
​;; which equals 1​
​;;​
​;; There is a single BSL expression that both produces the correct result,​
​;; and most closely matches the structure of the equation given above.​
​;; Although 1 is an expression that evaluates to 1, that is not the​
​;; correct answer, because it doesn't show the structure of the expression​
​;; above.​
​;;​

​(+ (sqr 3) (/ (* 6 (- 6 10)) 3))​




(​ @problem 2)​
​;;​
​;; Given the definitions below (LOWER, UPPER and foo),​
​;; write the step-by-step evaluation of the following expression:​
​;;​
​;; (foo (* 3 4) (+ 0 2))​
​;;​
​;; Be sure to show every intermediate evaluation step, including the original​
​;; expression and the final result. The steps should NOT be in comments.​
​;;​
​;; Stepping questions like this one have only one correct answer. The goal​
​;; of this problem is to assess whether you have learned the exact BSL step​
​;; by step evaluation rules; not whether you can figure out the final​
​;; result of an expression.​
​;;​

​(define LOWER 10)​

, ​(define UPPER 20)​

​(define (foo x y)​
​(if (and (> x LOWER) (< x UPPER))​
​(- x (* y 2))​
​(+ x (* y 3))))​

​(foo (* 3 4) (+ 0 2))​

​(foo 12 (+ 0 2))​

​(foo 12 2)​

​(if (and (> 12 LOWER) (< 12 UPPER))​
​(- 12 (* 2 2))​
​(+ 12 (* 2 3)))​

​(if (and (> 12 10) (< 12 UPPER))​
​(- 12 (* 2 2))​
​(+ 12 (* 2 3)))​

​(if (and true (< 12 UPPER))​
​(- 12 (* 2 2))​
​(+ 12 (* 2 3)))​

​(if (and true (< 12 20))​
​(- 12 (* 2 2))​
​(+ 12 (* 2 3)))​

​(if (and true true)​
​(- 12 (* 2 2))​
​(+ 12 (* 2 3)))​

​(if true​
​(- 12 (* 2 2))​
​(+ 12 (* 2 3)))​

​(- 12 (* 2 2))​

​(- 12 4)​

​8​




(​ @problem 3)​
​;;​
​;; Skye has written the following expression, and expects it to produce​
€8,57
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
06shyun1211

Maak kennis met de verkoper

Seller avatar
06shyun1211 University of British Columbia
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
Nieuw op Stuvia
Lid sinds
3 weken
Aantal volgers
0
Documenten
8
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen