Share Pastebin
Guest
Public paste!

itstas

By: a guest | Feb 9th, 2010 | Syntax: Java | Size: 4.01 KB | Hits: 42 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1.     //These functions are used for the calculations.
  2.         public void explodeval() {
  3.         //were going to grab the length of string, explode into a new array.
  4.                 Int leng = length(temp);
  5.                 char[] eqarray = new char[leng];
  6.                 //exploding into the array we just created.
  7.                 temp.getChars(0, leng, eqarray, 0);
  8.         }
  9.        
  10.         public void calculate(eqarray) {
  11.        
  12.         }
  13.        
  14.         public void makepretty() {
  15.                 //finally were going to implode, making the array back into a string, to push out as the final answer.
  16.         }
  17.        
  18.         public void evaluate() {
  19.                 //this is basically just going to execute EVERYTHING all at once.
  20.                 calculate();
  21.                 makepretty();
  22.         }
  23.        
  24.         public void findbrackets() {
  25.         }
  26.  
  27.     public static string Left(string temp, int pos, int leng){
  28.         return temp.Substring(pos, leng);
  29.     }
  30.  
  31.     public static string Right(string temp, int pos, int leng)
  32.       {
  33.             return temp.Substring(temp.Length - leng, leng);
  34.       }
  35.      
  36.      
  37.        
  38.         public void evexponents() {
  39.                 if(temp.contains("^")=="true"){
  40.                         for (string temp : ^) {
  41.                                 position = temp.indexOf("^");
  42.                                 left = getleft(temp, position);
  43.                                 right = getright(temp, position);
  44.                                 expo = left;
  45.                                 for (int i = 1; i < right; i++) {
  46.                                         expo = expo * left;
  47.                                 }
  48.                                 rep = left + position + right;
  49.                                 temp.replaceFirst(rep, expo);
  50.                         }
  51.                 }
  52.         }
  53.        
  54.         public void evmulti() {
  55.                 if(temp.Contains("*")=="true"){
  56.                         for (string temp : *) {
  57.                                
  58.                         }
  59.                 }
  60.         }
  61.        
  62.         public static getleft(string, position){
  63.                 int values[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
  64.                 int i = 1;
  65.                 if(int[] left(string, position, 2) == values[]){
  66.                         String a[] = left(string, postion, 2);
  67.                         if(int[] left(string, postion, 3) == values[]){
  68.                                 String b[] = left(string, position, 3) + a;
  69.                                 if(int[] left(string, position, 4) == values[]){
  70.                                         String c[] = left(string, position, 4) + b;
  71.                                         if(int[] left(string, position, 5) == values[]){
  72.                                                 String d[] = left(string, position, 5) + c;
  73.                                                 if(int[] left(string, position, 6) == values[]){
  74.                                                         String e[] = left(string, position, 6) + d;
  75.                                                         if(int[] left(string, position, 7) == values[]){
  76.                                                                 String f[] = left(string, position, 7) + e;
  77.                                                                 if(int[] left(string, position, 8) == values[]){
  78.                                                                         String g[] = left(string, position, 8) + f;
  79.                                                                         if(int[] left(string, position, 9) == values[]){
  80.                                                                                 String h[] = left(string, position, 9) + g;
  81.                                                                                 return h;
  82.                                                                         }else{
  83.                                                                                 return g;
  84.                                                                         }
  85.                                                                 }else{
  86.                                                                         return f;
  87.                                                                 }
  88.                                                         }else{
  89.                                                                 return e;
  90.                                                         }
  91.                                                 }else{
  92.                                                         return d;
  93.                                                 }
  94.                                         }else{
  95.                                                 return c;
  96.                                         }
  97.                                 }else{
  98.                                         return b;
  99.                                 }
  100.                         }else{
  101.                                 return a;
  102.                         }
  103.                 }
  104.         }
  105.  
  106.         public static getright(string, position){
  107.                 int values[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
  108.                 int i = 1;
  109.                 if(int[] right(string, position, 2) == values[]){
  110.                         String a[] = right(string, postion, 2);
  111.                         if(int[] right(string, postion, 3) == values[]){
  112.                                 String b[] = a + right(string, position, 3);
  113.                                 if(int[] right(string, position, 4) == values[]){
  114.                                         String c[] = b + right(string, position, 4);
  115.                                         if(int[] right(string, position, 5) == values[]){
  116.                                                 String d[] = c + right(string, position, 5);
  117.                                                 if(int[] right(string, position, 6) == values[]){
  118.                                                         String e[] = d + right(string, position, 6);
  119.                                                         if(int[] right(string, position, 7) == values[]){
  120.                                                                 String f[] = e + right(string, position, 7);
  121.                                                                 if(int[] right(string, position, 8) == values[]){
  122.                                                                         String g[] = f + right(string, position, 8);
  123.                                                                         if(int[] right(string, position, 9) == values[]){
  124.                                                                                 String h[] = g + right(string, position, 9);
  125.                                                                                 return h;
  126.                                                                         }else{
  127.                                                                                 return g;
  128.                                                                         }
  129.                                                                 }else{
  130.                                                                         return f;
  131.                                                                 }
  132.                                                         }else{
  133.                                                                 return e;
  134.                                                         }
  135.                                                 }else{
  136.                                                         return d;
  137.                                                 }
  138.                                         }else{
  139.                                                 return c;
  140.                                         }
  141.                                 }else{
  142.                                         return b;
  143.                                 }
  144.                         }else{
  145.                                 return a;
  146.                         }
  147.                 }
  148.         }
  149.        
  150.         public void evdivi() {
  151.         }
  152.        
  153.         public void evadd() {
  154.         }
  155.        
  156.         public void evsub() {
  157.         }