(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
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment