SlideServe
Menu
Préférences
© SlideServe · v2026

GBK Programming 1

dimaia avatar
14 diapositives · 258 Views · Aug 01, 2014

GBK Programming 1. Jordan Johnson Introducing DrRacket. Today’s plan. Greetings GBK Today Class Web site DrRacket and programming Assignments Clean-up. DrRacket : Anatomy. Evaluate the definitions. Definitions. Interactions. Important Terms. Definitions area:

GBK Programming 1 - slide 1
01 / 14GBK Programming 1
1 / 17

Télécharger la présentation

GBK Programming 1
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. GBK Programming 1 Jordan Johnson Introducing DrRacket

  2. Today’s plan Greetings GBK Today Class Web site DrRacketand programming Assignments Clean-up

  3. DrRacket: Anatomy Evaluate the definitions Definitions Interactions

  4. Important Terms • Definitions area: • area for writing programs • “Save” saves its contents • “Run” computes the results of its contents • Interactions area: • area for testing & experimentation • DrRacket prompts you for a program… • …and then returns your program’s result. • Programs consist of expressions

  5. Simple programs in BSL • (BSL = “Beginning Student Language”) • Expressions are one of the following: • something simple (a number), or • ( …more than one thing… ) • Compound expressions always start & end with parens.

  6. Simple programs (refined) • Expressionsare one of the following: • something simple (a number), or • (AN-OPERATION AN-EXPRESSION …) • AN-OPERATION stands for the name of some operation like +, *, sin, and so on… • When you see a “(“, the thing afterwards is always* an operation.

  7. “Something simple”:more than numbers • Other types of data: • strings: • “howdy there” • “55” • booleans: • true • false • images:

  8. Operations • On numbers: • +, -, *, /, expt, sin, … • <, >, <=, >=, = • On strings: • string-length • string-append • substring • On booleans: • and • Or

  9. Practice • Use the Interactions window to try some operations: • Multiply three or four numbers • Take the square root of a number • Add two numbers and convert the result to a string • Append several strings together • Compute the length of a string

  10. Expressions inside expressions • As the definition of expressions suggests, we can nest them: • (number->string (string-length “potato”))  “6” • (sqrt (+ (* 5 5) (* 12 12)))  13

  11. Definitions • The top half of the window is the Definitions area. • Executed when you click “Run”. • Contents remain saved. • Can contain expressions and definitions. • Example definitions: • (define x 8) • (define y 36)

  12. To Learn More The Help Desk lets you search for particular functions. If your cursor is on a function name, pressing F1 looks up the function’s help info.

  13. Due Date Reminders • By tomorrow: • Sign & return syllabus • Email me your HW #1 • All instructions are on the class website.

  14. Clean-up • Before you leave, please . . . • Log out. • Push in your chair. • Make sure you’ve got everything. • Make sure all trash ends up in the trash can.