import java.awt.*;
public class radish02 extends java.applet.Applet {
int radish[][] = new int[12][31];
int days[] = new int[12];
public void init(){
days[0] = 31;
days[1] = 28;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;
int radisa[] = { 0, 0, 0, 0, 0, 0, 945, 945, 0, 945, 945, 0, 0, 0, 840, 840, 840, 735, 0, 0, 735, 735, 0, 735, 735, 0, 0, 735, 735, 840, 735 };
int radisb[] = { 735, 0, 0, 735, 735, 735, 735, 735, 0, 0, 0, 735, 0, 735, 735, 0, 0, 630, 630, 630, 630, 630, 0, 0, 630, 630, 0, 630, 0, 0, 0 };
int radisc[] = { 630, 0, 0, 630, 525, 525, 525, 525, 0, 0, 525, 525, 0, 525, 525, 0, 0, 525, 525, 525, 0, 525, 0, 0, 840, 840, 0, 945, 945, 0, 0 };
int radisd[] = { 1365, 1365, 1155, 1050, 1050, 0, 0, 1050, 1050, 0, 1050, 1260, 0, 0, 1050, 1050, 1050, 1155, 1050, 0, 0, 1470, 1890, 0, 2100, 2100, 0, 0, 0, 1575, 0 };
int radise[] = { 1365, 1365, 0, 0, 0, 0, 1785, 0, 1890, 1890, 0, 0, 1680, 1680, 1575, 1575, 1680, 0, 0, 1890, 2100, 0, 2100, 2100, 0, 0, 1680, 1680, 1680, 1680, 1575 };
int radisf[] = { 0, 0, 1470, 1470, 1365, 1260, 1260, 0, 0, 1050, 1050, 0, 1050, 1050, 0, 0, 1050, 1050, 1050, 1050, 1050, 0, 0, 1365, 1680, 0, 1785, 1785, 0, 0, 0 };
int radisg[] = { 1575, 1575, 0, 1575, 1365, 0, 0, 1260, 1155, 1155, 1155, 1155, 0, 0, 1050, 1050, 1050, 1050, 1050, 0, 0, 1050, 1050, 0, 1575, 1470, 0, 0, 1680, 1680, 1680 };
int radism[] = { 1785, 1890, 0, 0, 1785, 1680, 1575, 1575, 1575, 0, 0, 1575, 1785, 0, 0, 0, 0, 0, 1680, 1785, 1785, 1785, 1785, 0, 0, 2205, 2310, 0, 2100, 1890, 0 };
int radisi[] = { 0, 1575, 1575, 1575, 1575, 1575, 0, 0, 1785, 1890, 0, 1680, 1785, 0, 0, 0, 1680, 1680, 1575, 1575, 0, 0, 0, 1680, 0, 1575, 1470, 0, 0, 1260, 0 };
int radisj[] = { 1050, 1050, 1050, 1050, 0, 0, 840, 840, 0, 840, 840, 0, 0, 0, 840, 840, 840, 840, 0, 0, 840, 840, 0, 840, 840, 0, 0, 840, 840, 945, 945 };
int radisk[] = { 1050, 0, 0, 0, 1260, 1365, 1470, 1680, 0, 0, 1785, 1785, 0, 1680, 1680, 0, 0, 1785, 1785, 1890, 1995, 1995, 0, 0, 1890, 1890, 0, 1785, 1575, 0, 0 };
int radisl[] = { 0, 1470, 1365, 1365, 1365, 1365, 0, 0, 1365, 1470, 0, 1470, 1470, 0, 0, 1260, 1260, 1155, 1050, 1260, 0, 0, 0, 1260, 1260, 1260, 1260, 0, 0, 0, 0 };
for(int k=0; k<31; k++){
radish[0][k] = radisa[k];
}
for(int k=0; k<31; k++){
radish[1][k] = radisb[k];
}
for(int k=0; k<31; k++){
radish[2][k] = radisc[k];
}
for(int k=0; k<31; k++){
radish[3][k] = radisd[k];
}
for(int k=0; k<31; k++){
radish[4][k] = radise[k];
}
for(int k=0; k<31; k++){
radish[5][k] = radisf[k];
}
for(int k=0; k<31; k++){
radish[6][k] = radisg[k];
}
for(int k=0; k<31; k++){
radish[7][k] = radism[k];
}
for(int k=0; k<31; k++){
radish[8][k] = radisi[k];
}
for(int k=0; k<31; k++){
radish[9][k] = radisj[k];
}
for(int k=0; k<31; k++){
radish[10][k] = radisk[k];
}
for(int k=0; k<31; k++){
radish[11][k] = radisl[k];
}
}
public void paint(java.awt.Graphics g){
g.setColor(Color.white);
g.fillRect(0,0,800,400);
g.setColor(Color.black);
String s = "The price of Japanese radish 2002";
g.drawString( s, 50, 25);
int m = 50;
int n = 0;
int o = 50;
int p = 0;
int q = 50;
for (int j=0; j<12; j++){
for (int k=0; k
m = m + 2;
if (radish[j][k] != 0){
n = 350 - radish[j][k] / 10;
j = 12;
break;
}
}
}
g.setColor(Color.blue);
g.drawLine(q, 50, q, 350);
s = "Month";
g.drawString( s, 10, 370);
for (int j=0; j<12; j++){
q = m;
for (int k=0; k
o = o + 2;
if (radish[j][k] != 0){
p = 350 - radish[j][k] / 10;
g.setColor(Color.red);
g.drawLine(m, n, o, p);
m = o;
n = p;
}
}
g.setColor(Color.blue);
g.drawLine(o, 50, o, 350);
s = Integer.toString(j+1);
g.drawString( s, (q+o)/2-8, 370);
}
g.setColor(Color.magenta);
for (int l=0; l<4; l++){
g.drawLine(50, l*100+50, o, l*100+50);
if (l != 3){
s = Integer.toString(3000-l*1000);
g.drawString( s, 10, l*100+54);
}
}
}
}
June 14, 2003
|
The following clause.
|
ソフトウェア
|