Lesson 14 – Nested loops

Big Java 6

When you come in

  1. Connect to the Internet
  2. Log in to Piazza
  3. Start Bluej
  4. Navigate to laughton.com/obrien/sjsu/cs46a/CRT_lessons/ and open this lesson

Questions

Activity - Nested Loops

Record your participation in Piazza clicker question Lesson14 Q1

Write a pair of nested loops to print the following pattern. Don't just print "[][][][][][]"   3 times.We will do it together

[][][][][]
[][][][][]
[][][][][] 

Activity - Nested loops

Record your participation in Piazza clicker question Lesson14 Q2

Write nested loops that make the following pattern of symbols: (Note: there are no spaces) We will do this together also

#
##
###
####
#####
######

 

Concept - Random numbers

 

Activity - Random numbers

Record your participation in Piazza clicker question Lesson14 Q3

Write the segment of code to generate a random integer.

 

Program with a bug

Record your participation in Piazza clicker question Lesson14 Q4

 

Activity - Using the Bluej debugger - Cylinder

Record your participation in Piazza clicker question Lesson14 Q5

 

Activity - Using the Bluej debugger - StringIndexOutOfBounds

Record your participation in Piazza clicker question Lesson14 Q6

This program throws an exception.

Can you use the debugger to find out why?

  1. Figured it out
  2. Figured it but it was hard
  3. Couldn't do it in the time allowed
  4. Didn't know where to start

 

Lesson 6.2 on Udacity starting at unit 29 has a good set of videos on using the debugger where you can get more practice