CS10, 09S, UCSB
H15: Nested loops (section 6.3) and Recursion (section 13.1) Total points: ?
Accepted: on paper, in lecture (1-1:50pm) on Friday, May 27th only.
No email submission allowed.
Name One: (5 pts)______________________________ UCSBNetID (5 pts) _____________________
Section (5 pts) Circle one: Thu 4pm Fri 10am Fri 11am Fri noon
/**
This class describes triangle objects that can be displayed
as shapes like this:
[][][]
[][]
[]
@author P. Conrad, based on code by Horstman, Big Java 3rd edition, Section 6.3
@version for CS10, Spring 2009, Homework 15
*/
public class UpperLeftTriangle
{
private int width;
/**
Constructs a triangle.
@param aWidth the number of [] in the first row of the triangle.
*/
public UpperLeftTriangle(int aWidth)
{
width = aWidth;
}
/**
Computes a string representing the triangle.
@return a string consisting of [] and newline characters
*/
public String toString()
{
String r = "stub"; // @@ implement this
return r;
}
}