From the course: Java 8 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Challenge: Creating a more complex calculator application

Challenge: Creating a more complex calculator application - Java Tutorial

From the course: Java 8 Essential Training

Start my 1-month free trial

Challenge: Creating a more complex calculator application

- In this challenge, I'll ask you to create another calculator application. As with the previous calculator application, I'm prompted for two numeric values. I'll type in one, and then type in another but this version of my calculator can execute addition, subtraction, multiplication, or division. I'll type in the operator that I want to use, I'll use minus for subtraction, and I get back the result. I'll run the application again, and this time I'll execute another operation. I'll start with a value of 10 and then I'll put in a second value of 2 and then I'll divide, and I get back the answer. This application has a little bit of error handling going on. I'll run the application again, and this time I'll enter a value that's not numeric. It doesn't matter which one I enter, either will cause the error to be triggered. I'll enter a numeric value for the second one and then I'll choose an operation, but I get back this error message. This is a customized error message, I'm not just…

Contents