Professional Documents
Culture Documents
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (x < 333)
{
Expo.setColor(g,Expo.blue);
}
if (x >= 333 && x < 667)
{
Expo.setColor(g,Expo.white);
}
if (x >= 667)
{
Expo.setColor(g,Expo.red);
}
drawDot(g,x,y);
}
showName(g,"France");
}
public static void flagOfLithuania (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 217)
{
Expo.setColor(g,Expo.yellow);
}
if (y >= 217 && y < 434)
{
Expo.setColor(g,Expo.green);
}
if (y >= 434)
{
Expo.setColor(g,Expo.red);
}
drawDot(g,x,y);
}
showName(g,"Lithuania");
}
public static void flagOfLatvia (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 217)
{
Expo.setColor(g,Expo.violet);
}
if (y >= 217 && y < 434)
{
Expo.setColor(g,Expo.white);
}
if (y >= 434)
{
Expo.setColor(g,Expo.violet);
}
drawDot(g,x,y);
}
showName(g,"Latvia");
}
public static void flagOfColombia (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 325)
{
Expo.setColor(g,Expo.gold);
}
if (y >= 325 && y <488)
{
Expo.setColor(g,Expo.blue);
}
if (y >= 488)
{
Expo.setColor(g,Expo.red);
}
drawDot(g,x,y);
}
showName(g,"Colombia");
}
public static void rainbowFlag (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 109)
{
Expo.setColor(g,Expo.red);
}
if (y >= 109 && y < 217)
{
Expo.setColor(g,Expo.orange);
}
if (y >= 217 && y < 325)
{
Expo.setColor(g,Expo.yellow);
}
if (y >= 325 && y < 433)
{
Expo.setColor(g,Expo.green);
}
if (y >= 433 && y < 541)
{
Expo.setColor(g,Expo.blue);
}
if (y >= 541)
{
Expo.setColor(g,Expo.purple);
}
drawDot(g,x,y);
}
showName(g,"Rainbow");
}
public static void flagOfSweden (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 275)
{
Expo.setColor(g,Expo.blue);
}
if (y >= 275 && y < 375)
{
Expo.setColor(g,Expo.yellow);
}
if (y >= 375)
{
Expo.setColor(g,Expo.blue);
}
if (x >= 300 && x <= 400)
{
Expo.setColor(g,Expo.yellow);
}
drawDot(g,x,y);
}
showName(g,"Sweden");
}
public static void flagOfUSA (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 50)
{
Expo.setColor(g,Expo.red);
}
Expo.setColor(g,Expo.red);
}
if (y >= 525)
{
Expo.setColor(g,Expo.red);
}
if (x <= 225)
{
Expo.setColor(g,Expo.red);
}
if (x >= 775)
{
Expo.setColor(g,Expo.red);
}
drawDot(g,x,y);
}
showName(g,"Switzerland");
}
public static void flagOfTexas (Graphics g)
{
Expo.setBackground(g,Expo.black);
for (int d = 1; d <= numDots; d++)
{
int x = Expo.random(0,1000);
int y = Expo.random(0,650);
if (y < 325)
{
Expo.setColor(g,Expo.white);
}
if (y >= 325)
{
Expo.setColor(g,Expo.red);
}
if (x < 350)
{
Expo.setColor(g,Expo.blue);
}
drawDot(g,x,y);
}
showName(g,"Texas");
}
}
if (x >= 300 && x <= 400)
{
Expo.setColor(g,Expo.blue);
}
drawDot(g,x,y);
}
showName(g,"Finland");
}