void setup(){
size(500,500);
background(#DD0000);
int power = 6;
textSize(30);
text("Power of ten ="+power,width/2-200,height/2);
text("Word number is",width/2-200,height/2+50);
powerOfTen(power);
}
void powerOfTen(int Power_Ten){
if(Power_Ten==6) {
text("Million",width/2+30,height/2+50);
}else if(Power_Ten==9){
text("Billion",width/2+30,height/2+50);
}else if(Power_Ten==12){
text("trillion",width/2+30,height/2+50);
}else if(Power_Ten==15){
text("Quadrillion",width/2+30,height/2+50);
}else if(Power_Ten==18){
text("Quintillion",width/2+30,height/2+50);
}else if(Power_Ten==21){
text("Sextillion",width/2+30,height/2+50);
}else if(Power_Ten==30){
text("Nonillion",width/2+30,height/2+50);
}else if(Power_Ten==100){
text("Googol",width/2+30,height/2+50);
}
}
size(500,500);
background(#DD0000);
int power = 6;
textSize(30);
text("Power of ten ="+power,width/2-200,height/2);
text("Word number is",width/2-200,height/2+50);
powerOfTen(power);
}
void powerOfTen(int Power_Ten){
if(Power_Ten==6) {
text("Million",width/2+30,height/2+50);
}else if(Power_Ten==9){
text("Billion",width/2+30,height/2+50);
}else if(Power_Ten==12){
text("trillion",width/2+30,height/2+50);
}else if(Power_Ten==15){
text("Quadrillion",width/2+30,height/2+50);
}else if(Power_Ten==18){
text("Quintillion",width/2+30,height/2+50);
}else if(Power_Ten==21){
text("Sextillion",width/2+30,height/2+50);
}else if(Power_Ten==30){
text("Nonillion",width/2+30,height/2+50);
}else if(Power_Ten==100){
text("Googol",width/2+30,height/2+50);
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น