/home/sjenks/NetBeansProjects/CS2/src/frames/Person.java |
1
2
3
4
5 package frames;
6
7
8
9 @author
10
11 class Person {
12 public String person;
13
14 public Person() {
15 this.person = get();
16 }
17
18 public String get(){
19 int randNumb = (int) (Math.random() * 10 + 1);
20 if (randNumb == 1) {
21 person = personOne();
22 } else if (randNumb == 2) {
23 person = personTwo();
24 } else if (randNumb == 3) {
25 person = personThree();
26 } else if (randNumb == 4) {
27 person = personFour();
28 } else if (randNumb == 5) {
29 person = personFive();
30 }else if (randNumb == 6) {
31 person = personSix();
32 }else if (randNumb == 7) {
33 person = personSev();
34 }else if (randNumb == 8) {
35 person = personEig();
36 }else if (randNumb == 9) {
37 person = personNine();
38 }else if (randNumb == 10) {
39 person = personTen();
40 }
41 return person;
42
43 }
44
45 private String personOne() {
46 String personOne= "Alan Turing: famously known for his contribtutions with "
47 + "the turing machine,Turing's efforts showed what was possible"
48 + "to be computational. ";
49 return personOne;
50 }
51
52 private String personTwo() {
53 String personTwo= "Tim Berners-Lee: an English engineer and computer "
54 + "scientist, best known as the inventor of the World Wide Web. ";
55 return personTwo;
56 }
57
58 private String personThree() {
59 String personThree= "Larry Page: Co-founded of Google with Sergey Brin and "
60 + "inventor of PageRank, a well-known search ranking algorithm "
61 + "for Google. ";
62 return personThree;
63 }
64
65 private String personFour() {
66 String personFour = "Sergey Brin: Was the other co- founder of google"
67 + "with Larry Page, and is the thirteenth richest person in the"
68 + "world at an estimate of 50.6 billion dollars. ";
69 return personFour;
70 }
71
72 private String personFive() {
73 String personFive = "Donald Knuth: He contributed to the development of"
74 + " the rigorous analysis of the computational complexity of "
75 + "algorithms and systematized formal mathematical techniques for it. ";
76 return personFive;
77 }
78
79 private String personSix() {
80 String personSix = "Ken Thompson: designed and implemented the original "
81 + "Unix operating system. He also invented the B programming language. ";
82 return personSix;
83 }
84
85 private String personSev() {
86 String personSev = "Ada Lovelace: People claim that she was the frist "
87 + "computer programer due to the fact that she was the first to "
88 + "recognise that the machine had applications beyond pure "
89 + "calculation, and published the first algorithm intended to "
90 + "be carried out by such a machine. ";
91 return personSev;
92 }
93
94 private String personEig() {
95 String personEig = "James Gosling: most commonly known as the father of"
96 + " the Java programming language, but also known to develope"
97 + "a version of Emacs. ";
98 return personEig;
99 }
100
101 private String personNine() {
102 String personNine = "Niklaus Wirth: He has designed several programming"
103 + " languages, including Pascal, and pioneered several classic"
104 + " topics in software engineering. ";
105 return personNine;
106 }
107
108 private String personTen() {
109 String personTen = "Grace Hopper: she was a pioneer of computer "
110 + "programming who invented one of the first compiler related "
111 + "tools, and popularized the idea of machine-independent "
112 + "programming languages. ";
113 return personTen;
114 }
115 }
116
117