import java.awt.*; public class SumWaves { SineWave w1; SineWave w2; public SumWaves(SineWave w1, SineWave w2) { this.w1 = w1; this.w2 = w2; } public void setWave1(SineWave sine1) { this.w1 = sine1; } public void setWave2(SineWave sine2) { this.w2 = sine2; } public int getY(int x) { return w1.getY(x)+w2.getY(x); } public void draw(Graphics g, int x, int y, int width) { int yloc1, yloc2; for (int i=0; i