//******************************************************************** // Bush.java // // Demonstrates the basic structure of a Java application //******************************************************************** public class Bush { //----------------------------------------------------------------- // Prints a quote by US President George W. Bush //----------------------------------------------------------------- public static void main (String[] args) { System.out.println ("A quote by George W. Bush:"); System.out.println ("We need an energy bill that encourages consumption."); } } //******************************************************************** // Bush2.java // // Demonstrates a poorly formated, though valid, program //******************************************************************** public class Bush2{public static void main(String[]args){System.out.println ("A quote by George W. Bush:");System.out.println ("We need an energy bill that encourages consumption.");}} //******************************************************************** // Bush3.java // // Demonstrates another poorly formated, though valid, program //******************************************************************** public class Bush3 { public static void main ( String [] args ) { System.out.println ( "A quote by George W. Bush:" ) ; System.out.println (" We need an energy bill that encourages consumption." ) ; } } //******************************************************************** // ChickenFlight.java Author: Yannick Daoudi // // Demonstrates the declaration, initialization, and use of an // integer variable. //******************************************************************** public class ChickenFlight { //----------------------------------------------------------------- // Prints the longest recorded flight of a chicken. //----------------------------------------------------------------- public static void main (String[] args) { int flightTime = 13; System.out.println ("The longest recorded flight of a chicken " + flightTime + " seconds."); } } //******************************************************************** // Time.java Author: Yannick Daoudi // // Demonstrates the use of an assignment statement to change the // value stored in a variable. //******************************************************************** public class Time { //----------------------------------------------------------------- // Prints useless time related facts. //----------------------------------------------------------------- public static void main (String[] args) { int seconds = 13; // declaration with initialization System.out.println ("The average yawn is " + seconds + " seconds long."); seconds = 3; // assignment statement System.out.println ("A goldfish has an attention span of " + seconds + " seconds."); seconds = 20; System.out.println ("Apollo 11 had " + seconds + " seconds of fuel left when it landed."); } } //******************************************************************** // TempConverter.java Author: Lewis and Loftus // // Demonstrates the use of primitive data types and arithmetic // expressions. //******************************************************************** public class TempConverter { //----------------------------------------------------------------- // Computes the Farenheit equivalent of a specific Celcius value // using the formula F=(9/5)C+32 //----------------------------------------------------------------- public static void main (String[] args) { final int BASE = 32; final double CONVERSION_FACTOR = 9.0 / 5.0; int celciusTemp = -25; //value to convert double farenheitTemp; farenheitTemp = celciusTemp * CONVERSION_FACTOR + BASE; System.out.println("Celcius Temperature: " + celciusTemp); System.out.println("Farenheit Temperature: " + farenheitTemp); } }