




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Introduction to computer science. Section Handout of Programming Methodology. FacePamphlet. Prof. Sahami. Stanford University.
Typology: Exercises
1 / 28
This page cannot be seen from the preview
Don't miss anything!





















(^1) Facebook, Orkut, and MySpace are trademarks of those respective social networking sites. They are referred to here only for eduational expository reasons.
add(new JLabel(EMPTY_LABEL_TEXT), WEST);
Figure 1. Illustration of Milestone 1
Figure 2. Starter file for the FacePamphletProfile class
/*
import acm.graphics.; import java.util.;
public class FacePamphletProfile implements FacePamphletConstants {
/**
/** This method returns the name associated with the profile. / public String getName() { // You fill this in. Currently always returns the empty string. return ""; } /* This method returns the image associated with the profile.
/** This method sets the image associated with the profile. */ public void setImage(GImage image) { // You fill this in }
/** This method returns the status associated with the profile.
/** This method sets the status associated with the profile. */ public void setStatus(String status) { // You fill this in }
/** This method adds the named friend to this profile's list of
/** This method removes the named friend from this profile's list
/** This method returns an iterator over the list of friends
/** This method returns a string representation of the profile.
}
Figure 3. Starter file for the FacePamphletDatabase class
/*
import java.util.*;
public class FacePamphletDatabase implements FacePamphletConstants {
/** Constructor
/** This method adds the given profile to the database. If the
/** This method returns the profile associated with the given name
/** This method removes the profile associated with the given name
/**
GImage image = null; try { image = new GImage(filename); } catch (ErrorException ex) { // Code that is executed if the filename cannot be opened. }