I made these in my spare time... I'm new to Java don't flame =)
--------------------
This will compute the area of a circle.
--------
----------------------------------
This will compute the Hypotenuse of a triangle.
-------------
------------------------------------
This will compute the Speed of Light in Miles
---------
----------------------
Any requests? Ask me
--------------------
This will compute the area of a circle.
--------
Code:
/**
* Compute the area of a circle
* Copyright Vinny
* Java Math Kit V1
*/
class Area {
public static void main(String args[]) {
double pi, r, a; //Calling pi, Radi, Area
r = 10.8; //Change this Value to your Circles Radius
pi = 3.1416; //Dont change this.
a = pi * r *r;//Computing Area
System.out.println("The Area of the circle is " + a);
}
}
This will compute the Hypotenuse of a triangle.
-------------
Code:
/**
* This will calculate the Hypotenuse of a triangle
*
* Vinny
* Java Math Kit V1
*/
class Hypotenuse {
public static void main(String args[]) {
double a = 3.0, b = 6.0; // Feel free to change these Values to match your Triangle.
double c = Math.sqrt(a * a + b * b);
System.out.println("The Hypotenuse of your Triangle is " + c);
}
}
This will compute the Speed of Light in Miles
---------
Code:
/**
* Compute Distance light Travels in Miles.
*
* Copyright Vinny
* Java Math Kit V1.0
*/
class Light {
public static void main(String args[]) {
int lightspeed;
long days;
long seconds;
long distance;
//Speed of light travels at 18600 miles per second
lightspeed = 186000;
days = 1000; // Put how many days you need to compute here
seconds = days * 24 * 60 * 60; //Dont change this
distance = lightspeed * seconds;
System.out.println("In " + days);
System.out.println(" days light will travel ");
System.out.println(distance + " miles.");
}
}
Any requests? Ask me










