Académique Documents
Professionnel Documents
Culture Documents
*;
joptionpane.showmessagedialog(null,message,"while loop",
joptionpane.information_message);
double total=0;
int count=1;
string msg=null;
while(count <= maxnum){
switch(count){
case 1:
msg = "first";
break;
case 2:
msg = "second";
break;
case 3:
msg = "third";
break;
case 4:
msg = "fourth";
break;
}
total +=num;
++count;
}
joptionpane.showmessagedialog(null,"the total of the " + maxnum + " numbers
is " + total,
"result",joptionpane.information_message);
system.exit(0);
}
}