Course Solutions Uncategorized (Solved) : Please Make Uml Diagram Pseudocode Flowchart Import Javautilinputmismatchexception Import Q32942381 . . . .

(Solved) : Please Make Uml Diagram Pseudocode Flowchart Import Javautilinputmismatchexception Import Q32942381 . . . .

 

please make uml diagram , pseudocode and flowchart

import java.util.InputMismatchException;
import java.util.Scanner;

public class InputMismatch {

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int firstNum, secondNum=0;
while(true){
try{
System.out.println(“Enter·an·integer: “);
firstNum = scan.nextInt();
break;
}
catch(InputMismatchException e){
System.out.println(“Please·enter·an·integer”);
scan.next();
}
}
while(true){
try{
System.out.println(“Enter·an·integer: “);
secondNum = scan.nextInt();
break;

}
catch(InputMismatchException e){
System.out.println(“Please·enter·an·integer”);
scan.next();
}

}
int sum = firstNum + secondNum;
System.out.println(“The sum of two numbers is : “+sum);

}

}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Exercises 1a Output Produced Following Code Public Class Demo Public Static Void Main Stri Q29488133 . . . .(Solved) : Exercises 1a Output Produced Following Code Public Class Demo Public Static Void Main Stri Q29488133 . . . .

<p style="margin-left:5.65pt;"><strong>exercises     </strong></p><p>1a.What output will be produced by the following code?</p><p style="margin-left:23.65pt;">public class Demo</p><p style="margin-left:23.65pt;">{</p><p style="margin-left:44.1pt;">public static void main(String[]args)</p><p style="margin-left:44.1pt;">{</p><p>System.out.println("The output is:"); foo(23);</p><p>System.out.println();</p><p style="margin-left:44.1pt;">}</p><p style="margin-left:44.1pt;">public static void foo(intnumber)</p><p style="margin-left:44.15pt;">{</p><p>if (number >