Advertisement
EricJohnson

statistics

May 31st, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. public class Statistics{
  2.     public int setTtlTime(int gametime){
  3.         int ttltime;
  4.         ttltime+=gametime;
  5.         return ttltime;
  6.     }
  7.    
  8.     public void getttltime(){
  9.     }
  10.    
  11.     public int setTtlHits(int shiphits){
  12.         int ttlhits;
  13.         ttlhits+=shiphits;
  14.         return ttlhits;
  15.     }
  16.    
  17.     public void getTtlHits(){
  18.     }
  19.     //use insertion sort
  20.     public int setHitMiss(int hitmiss[]){
  21.             int in, out;
  22.  
  23.             for(out=1; out<nElems; out++)   // out is dividing line
  24.             {
  25.                 long temp = hitmiss[out];    // remove marked item
  26.                 in = out;           // start shifts at out
  27.                 while(in>0 && hitmiss[in-1] >= temp) // until one is smaller,
  28.                 {
  29.                     hitmiss[in] = hitmiss[in-1];      // shift item right,
  30.                     --in;            // go left one position
  31.                 }
  32.                 hitmiss[in] = temp;         // insert marked item
  33.             } // end for
  34.     }
  35.    
  36.    
  37.     public void getAvgHitMiss(){
  38.     }
  39.    
  40.     public int setHighestScore(highscore){
  41.         int temp;
  42.         temp=highscore;
  43.         if (highscore<temp){
  44.             highscore=temp;}
  45.         return highscore;
  46.     }
  47.    
  48.     public void getHighestScore(){
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement