Ditch the ads, upload images and much more - upgrade today from 5.95/month!
Read Contests Groups Learn Forums Store Help
 

JAVA Scripts (Personal Use)

Just a bunch of JAVA, really.
CONCENTRIC CIRCLES





import CSLib.*;

import java.awt.*;



public class Concentric {

//Draw concentric circles.

//Author: Adrienne Baranowicz, December 2, 2000



public void drawThem () {

DrawingBox g;

g = new DrawingBox();

g.setDrawableSize(300, 300);

g.setColor(Color.red);

g.drawOval(110, 110, 80, 80);

g.drawOval(95, 95, 110, 110);

g.drawOval(80, 80, 140, 140);

}

}





CLIENT



import CSLib.*;



public class ConcentricClient {



public static void main (String[] args) {

Concentric circles;

circles = new Concentric();

circles.drawThem();

}

}







DRAWINGCIRCLE





import CSLib.*;



public class DrawingCircle {



//Draw circle.

//Author: S. Kamin, April 10, 2001



public void draw () {



DrawingBox g;

g = new DrawingBox();

g.setDrawableSize(300, 300);



InputBox in;

in = new InputBox();

in.setPrompt("Enter diameter (=90)

out.print("A");

else if (score>=80)

out.print("B");

else if (score>=70)

out.print("C");

else if (score>=60)

out.print("D");

else

out.print("F");



OutputBox out = new OutputBox();

out.setTitle("Score");

}

}





SCORECLIENT



public class ScoreClient {



public static void main (String[] args) {

Outputbox Out = new Score();

out.compute();

}

}







SOCIALSECURITY





import CSLib.*;



public class SocialSecurity {

// Calculate and print the Social Security

// Self-Employment Tax on wages (to be read in).

// Author: Deborah R. Klapper, November 6, 1994



public void compute () {

final double

MAXIMUM_WAGE = 57600, // maximum wage subject to tax

TAX_RATE = 0.124; // tax rate on wages less than

// the maximum

double wages, // amount of wages subject to tax

tax; // amount of tax



InputBox in = new InputBox();

in.setTitle("Social Security Tax");

in.setPrompt("Your wages subject to Social Security are: $");

wages = in.readInt();



if (wages =25)&&(age<=40)) && (height<66) && (weight<140) && (smoke=='n') && (goodlooking=='y') && (relocate=='y'));

//1337

OutputBox out = new OutputBox();

out.setTitle("GetADate");

if (yes)

out.print("You qualify!");

else

out.print("You fail. N00b.");



}

}




PASSENGERS


import CSLib.*;

public class Passengers {
// Passengers of an Airship
// Author: Bethany J.M. Walker, November 15, 2006

public static void main (String[] args) {

int numberOfPassengers;

InputBox in = new InputBox();
in.setTitle("Passengers");
in.setPrompt("How many passengers?");
numberOfPassengers=in.readInt();

OutputBox out = new OutputBox();
out.setTitle("Passengers");

switch (numberOfPassengers){
case 0: out.print("A Motorcycle.");
break;
case 1: out.print("A Chocobo.");
break;
case 2:
case 3:
case 4: out.print("A ShinRa Truck.");
break;
case 5:
case 6: out.print("Cid's Highwind");
break;
case 7:
case 8: out.print("The Hilde Garde 1-3");
break;
default: out.print("The Garden.");

}
}
}

Add a comment

    : Comment:

Comments