Starting from:

$10

Scheme Basic Functions

Scheme Basic Functions
Building and Displaying a Simple Greet Function
1. Create the file SchemeFlipped1.scm. Inside that file, create a “printGreeting” method that
will display ALL members of your team. No parameters are necessary. You can use a
main() to start the overall Scheme program (and for the rest of your problems below).
Indent your code!! Treat the ()s as {}s!!
Simple Parameter Passing
2. Create the file SchemeIntro2.scm using Emacs. Inside that file, create a
“simpleParameter” method that will display any value you pass in. Indent your code!!
Treat the ()s as {}s!! We want TWO examples with TWO different datatypes.
Returning a Value
3. Create the file SchemeIntro3.scm. Inside that file, create a method named “CircleArea”.
This function should take one parameter, the radius of a circle and return its area. Indent
your code!! We want TWO separate calls to make sure it works.
Higher Order Functions
4. Create the file SchemeIntro4.scm. Inside that file, create a function named
“CurvedGrade” that accepts an integer and another function. CurvedGrade should use
the function passed in to modify the grade and return the value, while the main function
should display the returned value. Call CurvedGrade twice in main with two different
grades and two different curving functions as followed:
Function 1: multiply the grade by 1.2
Grade 1: 80
Function 2: add five to the grade
Grade 2: 90

More products