Outlab 4: Loops

Due: Monday 25 July at 10 pm

Purpose

Gain experience with for and while 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.

Tasks

Hints

  1. Work through one method at a time. They get progressively harder, so start with loop1. Test, test, test,
  2. Ask questions if a method's operation does not make sense. Here is sample output.
  3. Consider using nested for loops for loop3(). Also, consult the java String class online documentation to make loop3() 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 loop4 and loop5. 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 Monday 25 July at 10:00 pm, submit the files Driver.java and Loop.java into the appropriate D2L dropbox folder. DO NOT SUBMIT .class files!

Grading - 20 points

5 points lost automatically if Loop.java does not compile with the a different Driver.