Professional Documents
Culture Documents
#3 Java Input and Arithmetic Operators - PRELIM
#3 Java Input and Arithmetic Operators - PRELIM
1. Built-in Packages
2. Importing Packages
3. Java.util.Scanner;
4. User Input
5. Arithmetic Operators
6. Activity
BUILT-IN PACKAGES
Click to edit Master title style
String x;
Scanner s = new Scanner(System.in);
x = s.nextLine();
Click to edit Master title style
Click to edit Master title style
Click to edit Master title style
Create Error
USER INPUT
Click to edit Master title style
• nextLine()
• nextInt()
• nextShort()
• nextLong()
• nextByte()
• nextBoolean()
• nextDouble()
• nextFloat()
Click to edit Master title style
Click to edit Master title style
Arithmetic
Operators
ARITHMETIC OPERATORS
Click to edit Master title style
Change operator
+-*/
Click to edit Master title style
Perform operation
directly
Click to edit Master title style
Perform operation
to variable
Click to edit Master title style
Click to edit Master title style
Click to edit Master title style
Using modulus
Using float
Click to edit Master title style
Click to edit Master title style
Increment
Click to edit Master title style
Decrement
Click to edit Master title style
LESSON
ACTIVITY
SIMPLE CALCULATOR
Click to edit Master title style
Sample Output:
Num1 : 5
Num2 : 5
Result : 5 + 5 = 10
Click to edit Master title style 1st Solution
Click to edit Master title style 2nd Solution
Click to edit Master title style
Thank You. ❤