Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions