PDA

dsptl
03-19-2009, 03:09 AM
Problem Number 8:

http://i44.tinypic.com/2ds1vns.jpg
http://i42.tinypic.com/2mq5353.jpg

My work so far:

import jpb.*;
import java.awt.*;
import java.util.*;
public class StockChart
{
public static void main(String[] args)
{
int width = 0;
int height = 0;
String StockName;
String m, t, w, r, f, w1, h;
double mon, tues, wed, thur, fri;

SimpleIO.prompt("Enter the name of the stock:");
SimpleIO.prompt("Enter stock price on Monday:");
SimpleIO.prompt("Enter stock price on Tuesday:");
SimpleIO.prompt("Enter stock price on Wednesday:");
SimpleIO.prompt("Enter stock price on Thursday:");
SimpleIO.prompt("Enter stock price on Friday:");
SimpleIO.prompt("Enter width of chart:");
width = Integer.parseInt(w1);
SimpleIO.prompt("Enter height of chart:");
height = Integer.parseInt(h);

DrawableFrame df = new DrawableFrame("Chart for " + StockName);
df.show();
df.setSize(width, height);
Graphics g = df.getGraphicsContext();

{
g.setColor(Color.red);
g.fillRect(0, (height/2), (width/5), (height/2));
g.setColor(Color.blue);
g.fillRect(0, (height/2), (width/5), (height/2));
g.setColor(Color.green);
g.fillRect(0, (height/2), (width/5), (height/2));
g.setColor(Color.magenta);
g.fillRect(0, (height/2), (width/5), (height/2));
g.setColor(Color.cyan);
g.fillRect(0, (height/2), (width/5), (height/2));
}

}
}

Please Help.....From this point we don't know what to do and he never went over this :confused: :( :confused: