Contact Us
Order Here
Get Help
More
English
Español
Português
Français
Deutsch
Italiano
Русский
close
Contact Us
Order Here
Get Help
Starting from:
$30
$24
Buy now
Bonus Assignment #1 Solution
Modify your Assignment3 so that we can check input errors. Please refer to the following Java code.
import java.util.Scanner;
public class inputError5 {
public static void main(String[] args) {
Scanner consol=new Scanner(System.in);
int choice=0;
while(true){
System.out.println("============================="); System.out.println("= 1. function1 ="); System.out.println("= 2. function2 ="); System.out.println("= 3. function3 ="); System.out.println("============================="); System.out.print("Select : ");
choice= consol.nextInt();
switch(choice){
case 0: System.out.println("Bye!! ");
System.exit(0);
case 1: function1();
break;
case 2: function2();
break;
case 3: function3();
break;
default:System.out.println("Wrong number!! Type 1~3 "); break;
}
} // while
}
public static void function1(){
System.out.println("function1");
}
public static void function2(){
System.out.println("function2");
}
public static void function3(){
System.out.println("function3");
}
}
$30
Starting from:
$24
Buy now
1 file (3.2KB)
More products
$6.00 OFF
Lab 07 Numerical Integration and Fibonacci Solution
$30
$24
Buy now
$6.00 OFF
Lab 06 Nearest Neighbor Search Solution
$30
$24
Buy now
$6.00 OFF
Lab 05 Breadth-First and Depth-First Search Solution
$30
$24
Buy now