/home/sjenks/NetBeansProjects/CS2/src/frames/Quote.java
  1 /*
  2  * The class to generate a random quote from ten selections. Quotes were taken
  3  * from either their respective pages or from this link: 
  4  * http://www.devtopics.com/101-more-great-computer-quotes/
  5  */
  6 package frames;
  7 
  8 /**
  9  *
 10  * @author sjenks
 11  */
 12 class Quote {
 13     public String quote;
 14     
 15     public Quote() {
 16         this.quote = get();
 17     }
 18     
 19     public String get(){
 20         int randNumb = (int) (Math.random() * 10 + 1);
 21         if (randNumb == 1) {
 22             quote = quoteOne();
 23         } else if (randNumb == 2) {
 24             quote = quoteTwo();
 25         } else if (randNumb == 3) {
 26             quote = quoteThree();
 27         } else if (randNumb == 4) {
 28             quote = quoteFour();
 29         } else if (randNumb == 5) {
 30             quote = quoteFive();
 31         }else if (randNumb == 6) {
 32             quote = quoteSix();
 33         }else if (randNumb == 7) {
 34             quote = quoteSev();
 35         }else if (randNumb == 8) {
 36             quote = quoteEig();
 37         }else if (randNumb == 9) {
 38             quote = quoteNine();
 39         }else if (randNumb == 10) {
 40             quote = quoteTen();
 41         }
 42         return quote;
 43     
 44 }
 45 
 46     private String quoteOne() {
 47         String quoteOne= "“Programs must be written for people to read, and only"
 48                 + " incidentally for machines to execute.” ~ Abelson and Sussman ";
 49         return quoteOne;
 50     }
 51 
 52     private String quoteTwo() {
 53         String quoteTwo= "“A program is never less than 90% complete, and never "
 54                 + "more than 95% complete.” ~Terry Baker ";
 55         return quoteTwo;
 56     }
 57 
 58     private String quoteThree() {
 59         String quoteThree= "“I would have to create a system with common rules "
 60                 + "that would be acceptable to everyone. That meant as close as "
 61                 + "possible to no rules at all.” ~Tim Berners-Lee ";
 62         return quoteThree;
 63     }
 64 
 65     private String quoteFour() {
 66         String quoteFour = "“I think it’s a new feature.  Don’t tell anyone it "
 67                 + "was an accident.” ~Larry Wall ";
 68         return quoteFour;
 69     }
 70 
 71     private String quoteFive() {
 72         String quoteFive = "“I see little commercial potential for the Internet "
 73                 + "for at least ten years.” ~Bill Gates, 1994 ";
 74         return quoteFive;
 75     }
 76 
 77     private String quoteSix() {
 78         String quoteSix = "“Sometimes it is the people no one can imagine "
 79                 + "anything of who do the things no one can imagine.” ~Alan Turing ";
 80         return quoteSix;
 81     }
 82         
 83     private String quoteSev() {
 84         String quoteSev = "“People think of security as a noun, something you "
 85                 + "go buy. In reality, it's an abstract concept like happiness."
 86                 + "Openness is unbelievably helpful to security.” ~James Gosling ";
 87         return quoteSev;
 88     }
 89 
 90     private String quoteEig() {
 91          String quoteEig = "“I was interested in doing it, there was an "
 92                  + "opportunity, so I just did it.” ~Barbara Liskov ";
 93         return quoteEig;
 94     }
 95 
 96     private String quoteNine() {
 97          String quoteNine = "“Being abstract is something profoundly different"
 98                  + "from being vague. The purpose of abstraction is not to be "
 99                  + "vague, but to create a new semantic level in which one can"
100                  + "be absolutely percise” ~ E.W. Dijkrstra ";
101         return quoteNine;
102     }
103 
104     private String quoteTen() {
105          String quoteTen = "“There are only two things wrong with C++:  The "
106                  + "initial concept and the implementation.” ~Bertrand Meyer ";
107         return quoteTen;
108     }
109 }
110