Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1 : Use string primitives to create an expression that concatenates prefix and suffix and adds _ between them (so you get hello_world when
- Problem 1: Use string primitives to create an expression that concatenates prefix and suffix and adds "_" between them (so you get "hello_world" when you run the program).
(@problem 1) ;; Complete Problem 1 below using the following constants
(define PREFIX "hello") (define SUFFIX "world")
- Problem 2: Use string primitives to create an expression that adds "_" at position i (the position that is i characters from the left of the string). Again, in this particular example, the expected result is "hello_world".
;; Complete Problem 2 below using the following constants
(define STR "helloworld") (define i 5)
- Problem 3: Create an expression that counts the number of pixels in the CAT image.
(@problem 3) ;; Complete Problem 3 below using the following constant
(define CAT (bitmap/url "https://edx-course-spdx-kiczales.s3.amazonaws.com/HTC/lab/cat.png"))
Complete these problems:
- Problem 4: Create an expression that computes whether CAT is "tall" (height is larger than its width), "wide" (width is larger than its height), or "square" (height is the same as its width).
(@problem 4) ;; Complete Problem 4 below using CAT as defined above
- Problem 5: Create an expression that computes whether the first character in STR is "h". In this example, the expected result is true.
(@problem 5) ;; Complete Problem 5 below using STR as defined above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started