Java Tutorial EP4 - Calculator with User Input!

Channel:
Subscribers:
65
Published on ● Video Link: https://www.youtube.com/watch?v=cYPpq8MeOPI



Category:
Tutorial
Duration: 6:21
1,032 views
2


I show you how to implement Scanner listeners! Now you can input your own numbers to use.
If your too lazy to type this out, here's the code:

import java.util.*;

public class InputCalculator {

public static void main(String[] args) {

System.out.println("Enter your first number to add: ");

Scanner scan = new Scanner(System.in);

int num1 = scan.nextInt();

System.out.println("Enter your second number: ");
int num2 = scan.nextInt();

int num3 = num1 + num2;
System.out.println("Your answer is: " + num3);

}

}







Tags:
Java (Programming Language)
Computer
Tutorial
Windows
Maker
Desktop
Input/output
Calculator (Invention)
Programming Language (Software Genre)
ARGaming
Software (album)
Java (Software)
Basic
Visual
Computers
Install
Linux
Linux Kernel (Software)
Ubuntu
Help
Using
System
Screen
Technology
Rpg
Howto