Advertisement
oona

people with asperger's syndrome

Mar 24th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.29 KB | None | 0 0
  1.  
  2. public class aspergerPeople {
  3.  
  4.     public static void main(String[] args) {
  5.         // TODO Auto-generated method stub
  6.        
  7.         String names[] = {"Olivia", "Jack", "Aidan", "Nina", "Cedric"}; //people with Asperger's Syndrome
  8.         String bestRoutine[] = {"watch the best films more than once a year", "sort batteries", "eat certain meals", "doodle after homework", "take a walk at 4 o'clock in the morning"}; //what has to be repeated in their daily life
  9.         String specialInterest[] = {"Painting", "Batteries", "Astronomy", "Fennec foxes", "Maths"}; //what are their intense beloved interests
  10.         String worstDifficulty[] = {"school", "having to talk about absolutely talentless things that interest others", "avoiding eye-contact", "making friends", "saying things that sound rude to others"}; //what are their social problems
  11.         int ageOfDiagnosis[] = {12, 9, 15, 10, 19}; //when were they diagnosed with AS
  12.        
  13.         printInventory(names, bestRoutine, specialInterest, worstDifficulty, ageOfDiagnosis);
  14.  
  15.     } //main ends here
  16.    
  17.     static void printInventory(String[] names, String[] bestRoutine, String[] specialInterest, String[] worstDifficulty, int[] ageOfDiagnosis)
  18.     {
  19.         for(int i=0; i<names.length; i++)
  20.         {
  21.             for(int j=1; j<(names.length-i); j++)
  22.             {
  23.                 if(names[j-1].compareTo(names[j])<0)
  24.                 {
  25.                     String temp1 = names[j-1];
  26.                     names[j-1] = names[j];
  27.                     names[j] = temp1;
  28.                    
  29.                     String temp2 = bestRoutine[j-1];
  30.                     bestRoutine[j-1] = bestRoutine[j];
  31.                     bestRoutine[j] = temp2;
  32.                    
  33.                     String temp3 = specialInterest[j-1];
  34.                     specialInterest[j-1] = specialInterest[j];
  35.                     specialInterest[j] = temp3;
  36.                    
  37.                     String temp4 = worstDifficulty[j-1];
  38.                     worstDifficulty[j-1] = worstDifficulty[j];
  39.                     worstDifficulty[j] = temp4;
  40.                    
  41.                     int temp5 = ageOfDiagnosis[j-1];
  42.                     ageOfDiagnosis[j-1] = ageOfDiagnosis[j];
  43.                     ageOfDiagnosis[j] = temp5;
  44.                 } //if statements end here
  45.             } //inner loop ends here
  46.         } //outer loop ends here
  47.         for(int i=0; i<names.length; i++)
  48.         {
  49.             System.out.println("Meet this person with Asperger's Syndrome: " + names[i] + ", diagnosed at the age of " + ageOfDiagnosis[i] + ". Biggest difficulty: " + worstDifficulty[i] + ". Special interest: " + specialInterest[i] + ". Most significant routine: " + bestRoutine[i]);
  50.         }
  51.     }
  52.  
  53. } //program ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement