Question: JAVA PROGRAMMING( SHOW OUTPUT PICTURE) 1. Write a Java program called Arithmetic Test that takes three command-line arguments: two integers and in between an arithmetic

JAVA PROGRAMMING( SHOW OUTPUT PICTURE)

JAVA PROGRAMMING( SHOW OUTPUT PICTURE) 1. Write a Java program called Arithmetic

1. Write a Java program called Arithmetic Test that takes three command-line arguments: two integers and in between an arithmetic operator (+,-, *, .. The program shall perform the corresponding operation on the two integers and display the result. Note that you need to deal with the nonnumeric input as operands (one of the two integers) using exception handler (try-catch statements) - the program terminates if any operand is nonnumeric, and it should display a message with the wrong operand input before exiting. Besides, the program should also handle the wrong input for operator. Example runs: java ArithmeticTest 12 + 34 12 + 34 = 46.0 java ArithmeticTest 12 "*" 34 12 * 34 = 408.0 java ArithmeticTest 7/8 - 34 Wrong Input: 7/8 java ArithmeticTest 78-3;4 Wrong Input: 3;4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!