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 - Java Tutorial
From the course: Java 8 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
Programming conditional logic3m 45s
-
Using the switch statement4m 51s
-
Creating looping code blocks5m 23s
-
Creating reusable code with methods4m 15s
-
Overloading methods with different signatures4m 51s
-
Passing arguments by reference or by value4m 47s
-
Challenge: Creating a more complex calculator application1m 53s
-
Solution: Creating a more complex calculator application3m 23s
-
-
-
-
-
-
-