Vending Machine (Preamble)
<%@ page import=“java.util.*” %>
String [] snacks = {“Chips”, “Popcorn”, “Peanuts”, . . . } ;
Vector selections = (Vector) session.getAttribute(“selections”) ;
if (selections == null) {
selections = new Vector() ;
session.setAttribute(“selections”, selections) ;
String selection = request.getParameter(“selection”) ;
selections.addElement(selection) ;