Answer to Question #124140 in Java | JSP | JSF for saad

Question #124140
(a)- How the compilation process of the Java language is different from that of C++ programming language. Discuss in details.

(b)- 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);
}
1
Expert's answer
2020-06-26T07:38:25-0400
Dear saad, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS