size(550, 500);
background(0);
fill(#DD0000);
textSize(30);
int power = 12;
cal_ten(power);
}
//calculation power of ten
void cal_ten(int power) {
int x = 50;
int y = 225;
if (power < 6) {
text("Have no word for this number", x, y+50);
} else if (power == 6) {
text("6", x+80, y+50);
text("Million", x+300, y+50);
} else if (power == 9) {
text("9", x+80, y+50);
text("Billion", x+300, y+50);
} else if (power == 12) {
text("12", x+75, y+50);
text("Trillion", x+300, y+50);
} else if (power == 15) {
text("15", x+75, y+50);
text("Quadrillion", x+300, y+50);
} else if (power == 18) {
text("18", x+75, y+50);
text("Quintillion", x+300, y+50);
} else if (power == 21) {
text("21", x+75, y+50);
text("Sextillion", x+300, y+50);
} else if (power == 30) {
text("30", x+75, y+50);
text("Nonillion", x+300, y+50);
} else if (power == 100) {
text("100", x+65, y+50);
text("Googol", x+300, y+50);
} else {
text("Have no word for this number", x, y+50);
}
text("Power of 10", x, y);
text("Number", x+300, y);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น