Yorkville High School Computer Science Department
Yorkville High School Computer Science Department on Facebook  Yorkville High School Computer Science Department Twitter Feed  Yorkville High School Computer Science Department on Instagram

Yorkville High School Computer Science

ASSIGNMENTS: No Current Assignments

AP Computer Science :: Projects :: Loopy Designs

Lesson (Website)
Lesson (Slides)
Due: Database Error

Problem

Create the following class:

public class LoopyRectangle {
	public static void main(String[] args) {
		final int LENGTH = 11;
        
		for (int i = 1; i <= LENGTH; i++) {
			for (int j = 1; j <= LENGTH; j++)
				System.out.print("*");
			System.out.println("");
		}
	}
}

The code above should generate a rectangle of stars. Create a class for each of the following scenarios using for loops:

Scenario 1: Triangle

Loopy Rocks Triangle

Scenario 2: Pyramid

Loopy Rocks Pyramid

Scenario 3: Diamond

Loopy Rocks Diamond

Scenario 4: Diamond Outline

Loopy Rocks Diamond Outline

Instructions

  1. You can create more code than just the pair of for loops created in the original example.
  2. Create a different class for each scenario.
  3. There is no rubric for this project. Each scenario is worth 10 points and it either works or it doesn't.

Project Extension

Create your own scenario and create it using stars.

Yorkville High School Computer Science Department on Facebook Yorkville High School Computer Science Department Twitter Feed Yorkville High School Computer Science Department on Instagram