tutorial 00 resources and course review. a00q4.rkt (define my-tutorial-info (list ………))
TRANSCRIPT
![Page 1: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/1.jpg)
TUTORIAL 00
Resources and Course Review
![Page 2: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/2.jpg)
a00q4.rkt
(define my-tutorial-info (list ………))
![Page 3: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/3.jpg)
MarkUs
Found under Assignments -> MarkUs
Do NOT use Internet Explorer (it does not work)
Ensure the filenames match the given filenames
E.g. “a00q4.rkt”, NOT “aOOq4.rkt”
Submit EARLY and OFTEN, NOT at the last minute
More information on the course website if you need more help
![Page 4: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/4.jpg)
Piazza
Discussion forum to ask questions and clarifications about assignments and course materials
All announcements about the course will be posted on Piazza instead of course website.
Activate your account by following the link sent to your UW email address
![Page 5: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/5.jpg)
Removing Email Messages
1. Top-right corner
2. Account/Email Settings
3. Scroll down to Class & Email Settings
4. Click “No Emails” for both options
5. Save Settings
![Page 6: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/6.jpg)
Piazza Tips
Do NOT post any code related to
assignment questions
Do NOT post questions asking for someone to debug your code:
E.g. “I get <some random error message> when I run my program. Why is this happening?”
![Page 7: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/7.jpg)
Read assignment CAREFULLY before posting on Piazza. Your question may have already been answered
Use Piazza search function to avoid repeated questions
Use meaningful
names when posting
new topic
e.g. “Values consumed
for a01q3”, NOT “a01q3”
![Page 8: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/8.jpg)
Design Recipe Review
![Page 9: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/9.jpg)
Purpose
;; (fn-name p1 p2 … pn) produces_____
Briefly describe what your function does
i.e how it uses the consumed values to produce the produced values
Mention the names of your parameters
Do NOT copy and paste from the assignment question. We WILL deduct marks!
![Page 10: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/10.jpg)
Contracts - Overview
;; fn-name: Type1 Type2… Typen-> Produced_Value
Capitalize the first letter of each data type
Be specific:
Between Int, Num, Nat
Add requirements as needed: nonempty, >, <, >=, <=, >=len, etc - be sure to mention parameter (by name) that the requirement applies to
![Page 11: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/11.jpg)
If data definitions are given, use them!
E.g. structures, lists etc.
;; A JOB is a list (list Str Sym Nat), ;; requires:;; the first list value is the job title, ;; and it must be nonempty;; the second list is the place of work;; the third list item is the number of hours ;; worked per week
;; fn-name: Type1 Job… -> Produced_Value
![Page 12: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/12.jpg)
Iclicker Question(define-struct module (lines test));; A Module is a (make-module Nat Nat)Program is list of Module.(create pa b)consumes a Program pa, and a non-negative number b, it produces true if the total number of lines and tests exceed b. Otherwise, it produces false.Which one of the following expression for contract is correct?
A. Nat Nat -> BoolB. Program Nat -> BoolC. (listof Module) Nat => BoolD. Two of above is correct
![Page 13: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/13.jpg)
Contracts - Common Mistakes
Improper type names - check the Style Guide
e.g. Use Str, NOT string
Capitalization - e.g. Use Num, not num
Incorrect types
No restrictions
Wrong number of parameters
Use ->, NOT =>
![Page 14: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/14.jpg)
Examples
;; Examples:(check-expect (fn-name p1 p2 … pn) expected_output)
Always include at LEAST 2 examples for recursive data:
Base case
Non-base case
![Page 15: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/15.jpg)
Tests;; Description of test (i.e. what are you testing?)(check-expect (fn-name p1 p2 … pn) expected_output)
Include ALL base cases and some non-base case tests
Include a test for every COND case
Be careful of nonempty list requirements – Don’t include an empty case
Examples do not need to be repeated in your Racket tests
![Page 16: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/16.jpg)
Style MistakesWhitespace:
Lines too longNo spacing between functions (too cluttered)
Use meaningful names for helper, parameters, constants etc.
E.g. total-amt, not x
Simplify code as much as possible!Use helper functions for repeated code
![Page 17: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/17.jpg)
Tips
Check Piazza daily for any announcements
READ assignment carefully for any restrictions
E.g. no reverse, use local only, etc.
Check post on Piazza for allowable functions
Check public tests to see if your code works
WARNING: This is NOT a thorough testing of your code
![Page 18: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/18.jpg)
Do NOT copy and paste anything directly from the pdf file.
Get help:
Instructor and ISA’s office hours
Set an appointment with us by email if the times don’t work:
Be careful of cheating!NEVER show any student your code
Discuss verbally without taking notes
Penalty for cheating is 0 on that assignment and -5% on your final grade, and possibly further disciplinary action
![Page 19: TUTORIAL 00 Resources and Course Review. a00q4.rkt (define my-tutorial-info (list ………))](https://reader035.vdocuments.site/reader035/viewer/2022070409/56649e965503460f94b9a49b/html5/thumbnails/19.jpg)
Good Luck!
Questions?