CS 1410-20 Homework 0

Due: Friday, August 26th, 2011 10:45am

Part 1 – Create Handin Account

After installing cs1410-handin.plt as described in the course web page, select the Manage CS 1410 Handin... menu item from DrRacket's File menu. Change to the New User panel, and pick a username and password. (Use your real name and real Utah student ID, so that we can connect your homework submissions with you.)

You will have to install cs1410-handin.plt for DrRacket on each different filesystem that you use to get a Handin button. However, after creating a handin account once from any machine, you can use DrRacket's Handin button on any other machine.

Part 2 – Define a Constant

Write a program that defines image1 to be a picture showing the number 17 raised to the 42nd power. The number should be in black text of size 12.

Don't paste an image into your program. Instead, use the functions expt, number->string, and text to create the image.

To run your program in DrRacket, you will need to include (require 2htdp/image) at the beginning of your program, in addition to selecting the Beginner Student language as described on the course web page.

Part 3 – Define Another Constant

In addition to image1, define image2 to be like image1, but with a blue background.

Use the functions image-width, image-height, rectangle, and overlay to define image2 in terms of image1.

Part 4 – Define a Function

Define the function on-blue that takes any image and places it on a blue background.

The process of defining image2 in terms of image1 should help you implement the function. Afterward, you could change the defintion of image2 to (define image2 (on-blue image1)), if you prefer.

Part 5 – Handin

Click the Handin button in DrRacket to submit your homework. The Handin button submits whatever is in DrRacket's definitions area, so click Handin after you ave defined image1, image2 and on-blue, all in the same program. The submission process will check that you have defined the right names.

Last update: Friday, November 4th, 2011