From the course: Java 8+ Essential Training: Syntax and Structure
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Challenge: A simple calculator - Java Tutorial
From the course: Java 8+ Essential Training: Syntax and Structure
Challenge: A simple calculator
- [Instructor] If you'd like to test your knowledge of Java so far, try creating this application. Don't open the project that's associated with this video. Instead, create a brand new project from scratch and add all of the code you need for this functionality. When I run the application, I'm prompted for a numeric value. I'll type a numeric value in and press enter or return, then I'm prompted for a second numeric value and I will type a value in and press enter or return again, and the two values are added together. To accept input, you'll need to use the scanner class with its next line method. You'll need to accept two values and save them as string variables, then you'll need to add the two values together and display the result. After you've finished your version of the application, watch the next video for my solution to this challenge.
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
-
-
-
-
-
-
Declare and initialize String objects3m 45s
-
Create and concatenate String values4m 34s
-
Convert primitive values to strings5m 30s
-
Build a String from multiple values10m 35s
-
Compare String values with methods5m 19s
-
Format numeric values as strings7m 2s
-
Parse String values4m 10s
-
Challenge: A simple calculator56s
-
Solution: A simple calculator1m 26s
-
-
-