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 Red Cross

In the context of the NPW, write a program called RedCross within the npw package to paint a red cross (plus symbol) in a 600 by 600 canvas whose legs are 500 by 100. Featured constraint: Create and use one and only one rectangle.

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 RedCross and placing it in the npw package.
    (b) Replacing the entire contents of the RedCross file with the entire contents of the BlueDot program.
    (c) Changing all occurrences of BlueDot to RedCross.
  2. Place all of the code for creating and using the sole rectangle 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: Minuet Figure Viewer

In the context of the MMW, write a program called MinuetFigureListener within the mmw package to simply play each of the Bach (JSB) minuet figures that are available in the MMW, in such a way that they are textually displayed. 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: Wednesday September 9, 2020
  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.