Computers and Technology, 27.06.2020 09:01 tonya3498
There is an application which inputs hundred numbers from the user, if user enters a positive number it increments valid numbers count. But if a user enters other than integer it terminates. You are required to make changes in given code such that instead of termination it shows message “input is not valid” and re input a number.
importjavax. swing.*;
publicclass QuestionNumber4 {
publicstaticvoidmain(String[] args) {
intcountValidNumber=0;
int num;
for(inti=0;i<100;i++){
System. out. print("Enter a Positive Number:");
String s1 =JOptionPane. showInputDialoge(“enter number”,null);
num = Integer. parseInt(s1);
if(num>0){
countValidNumber++;
}
}
System. out. println("Valid Numbers Are:"+countValidNumber);
}
Answers: 2
Computers and Technology, 21.06.2019 20:00
2.)how does a graphical user interface (gui) on a touchscreen interface differ from a gui on a desktop or laptop? a.)a finger or stylus is used instead of a pointer. b.) a magic wand is used instead of a pointer. c.)users speak commands instead of using a pointer. d.)users visualize commands instead of using a pointer.
Answers: 1
Computers and Technology, 22.06.2019 10:30
Choose the best explanation for the following statement communication is symbolic
Answers: 3
Computers and Technology, 22.06.2019 11:00
The great length of north america causes the climate to be varied. true false
Answers: 2
Computers and Technology, 22.06.2019 12:30
What characteristic of long period comets suggest they come directly from the oort cloud?
Answers: 2
There is an application which inputs hundred numbers from the user, if user enters a positive number...
Health, 12.04.2021 18:40
Mathematics, 12.04.2021 18:40
English, 12.04.2021 18:40
English, 12.04.2021 18:40
Mathematics, 12.04.2021 18:40
Mathematics, 12.04.2021 18:40
Mathematics, 12.04.2021 18:40
Chemistry, 12.04.2021 18:40
Mathematics, 12.04.2021 18:40