Dakpluto

PartA.java

Oct 31st, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. public class PartA {
  2.     public static void main(String[] args) {
  3.         System.out.println("hello!");
  4.  
  5.         double variable;
  6.  
  7.         variable = Math.sqrt(100.0) + 45.6;
  8.  
  9.         System.out.println("The Square Root of 100 + 45.6 is: " + variable);
  10.         System.out.println("2 to the 3rd power is " + Math.pow(2.0, 3.0));
  11.         System.out.println("10 to the 32nd power is " + Math.pow(10.0, 32.0));
  12.         System.out.println(Math.PI);
  13.  
  14.         String name = new String("Colin");
  15.  
  16.         int stringLength = name.length();
  17.         System.out.println("len has : " + stringLength);
  18.  
  19.         char myChar = name.charAt(3);
  20.         System.out.println(myChar);
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment