Outlab 4: Froot Loops

Due: Friday 11 March at 6 pm

Purpose

Gain experience with for and while loops. Also think about Froot Loops.

Partners

This is an individual assignment, though collaboration (not solution sharing) is allowed.

Problem Statement

The goal of this assignment is fairly simple: I describe 5 methods that you need to implement and you implement and test them. This is designed to not take too much time, so get it done quickly.

Assignment

Hints

  1. Work through one method at a time. They get progressively harder, so start with the first before moving onto the second. Test, test, test,
  2. Ask questions if a method's operation does not make sense. Here is sample output.
  3. Consult the java String class online documentation to make purple(...) fairly simple (Google: "Java String"). Find methods in the String class that will help you do what you want to do. Consider using String alph = "abcdefghijklmnopqrstuvwxyz" for something.
  4. Think first about what type of loop you want to do for blue(...) and orange(...). There is a correct answer.
  5. Be careful what parameters you pass the loops. It is not hard to get stuck in infinite loops. To kill program execution, right click the candycane icon in the lower left hand BlueJ screen. Select "Reset Java Virtual Machine".

Submission

By Friday 11 March at 6 pm, submit the files Driver.java and FrootLoops.java into the appropriate D2L dropbox folder. DO NOT SUBMIT .class files!

Grading - 20 points