Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Programming Challenge 1: Microworld Warmup

Overview

Your task is to write computational solutions to three problems, one in the context of the Nonrepresentational Painting World (NPW), and two in the context of the Modular Melody World (MMW) where one uses an SNote and the other uses an SComposer. Relatively rigid constraints will be placed on you as you engage in these tasks, as is appropriate for a first programming challenge in a CS1 course.

Why do it?

By composing Java solutions to the problems in the context of the featured microworlds you will:

  1. Gain practice in creating and using objects.
  2. Get acquainted with elements of graphics programming and sonic programming.
  3. Write programs with invariance in mind.
  4. Learn just a bit about how to work from language specifications.

The Entrance

Please be sure to complete Lab 2 before starting this assignment. Beyond that, you should study the programs featured in Lab 2. You should also take a some time to get at least casually familiar with the NPW functionality (Appendix 1 of the CS1 Lab Manual) and the MMW functionality (Appendix 2 of the CS1 Lab Manual).

Problem 1: The Orange Dots

In the context of the NPW, write a program called OrangeDots within the npw package to paint a little artistic creation using only circles. Create an 800 by 800 canvas and paint an orange dot with radius 200 in the middle of your canvas. Then, move the painter around the canvas to paint two more dots, half the size of the original, both overlapping with the outside of the big circle. See some examples below! Featured constraint: Create and use one and only one SCircle.

Other constraints:

  1. Use the technique of modifying an existing program that does something similar. Do so by:
    (a) Creating a new Java Class file for the program, naming it OrangeDots and placing it in the npw package.
    (b) Replacing the entire contents of the OrangeDots file with the entire contents of the BlueDot program.
    (c) Changing all occurrences of BlueDot to OrangeDots.
  2. Place all of the code for creating and using the sole circle object in the paintTheImage method.

Problem 2: Name that Song!

In the context of the MMW, write a program called MysterySong within the mmw package to play the exact same sequence of 14 notes as shown in the below figure. As in the class examples, the arrow points to the initial pitch you get when creating a note object. You may not use any SComposer objects. Thus you will have to write the program using only an SNote object. Once you’ve finished, see if you recognize the song!

Problem 3: Locomotion Listener

In the context of the MMW, write a program called LocomotionListener within the mmw package to simply play each of the motion and location related melodic sequences that are available in the MMW, in such a way that they are textually displayed. These melodic sequences mention things like ZigZag and Hills in their names. Do so by using Task 4 of Lab 2 as a model. That is, work by explicit analogy with the program featured in that task.

Due Date and Reminders

  1. Due date: Tuesday September 13, 2022
  2. Once you are ready, you must demo your programs for one of the TAs.
  3. Eventually, you will post relevant artifacts to your Web work site.