String number;
void setup() {
size(300, 300);
}
void draw() {
background(255);
frameRate(1);
power_of_ten(5, 100);
display_message(5, 200);
}
void power_of_ten(int x, int y) {
fill(0);
textSize(35);
text("Power of 10 : "+power, x, y);
}
void display_message(int x, int y) {
fill(0);
textSize(18);
text("Number : "+number, x, y);
power=power+1;
if (power==6) {
number="Million";
} else if (power==9) {
number="Billion";
} else if (power==12) {
number="Thillion";
} else if (power==15) {
number="Quadrillion";
} else if (power==18) {
number="Quintillion";
} else if (power==21) {
number="Sextillion";
} else if (power==30) {
number="Nonillion";
} else if (power==100) {
number="Googol";
} else {
number="No corresponding word";
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น