JAVA

Cards (42)

  • Arithmetic operators
    Operations that can be performed on numbers, such as addition, subtraction, multiplication, and division
  • Prenza NHS
  • Prenza 1 Marilao, Bulacan
  • Rhanel M. Llenareses
  • Email, Browsers, instant messaging and other applications

    Examples of what normally use when using a computer
  • SHS Teacher / SHS ICT Coordinator
  • Java application
    A program that performs when you use the Java command to run the Java Virtual Machine (JVM)
  • Program that prints a text
    1. // indicates comment line
    2. Blank lines can be used so that programs are easier to read
    3. This is a class declaration for the class Welcome
    4. A left brace indicates the beginning of the body of a class declaration
    5. This shows the starting point of a Java application
    6. This left brace starts the body of the method
    7. This directs the computer to do an action
    8. This right brace ends each class declaration
    9. This right brace must end the method declaration
  • Rules of Subtracting Binary Numbers
    1. 0 - 0 = 0
    2. 1 - 1 = 0
    3. 1 - 0 = 1
    4. 0 - 1 = 1
  • Example 1
    • 1 0 1 1 1 - 1 0 1 0 1 = 0 0 0 1 0
  • System.out
    A standard output object that allows Java application to display characters in the command window
  • System.out.println
    A method that displays a line of text in the command window
  • // indicates a comment line
  • Example 2
    • 1 1 0 1 1 0 - 1 0 0 0 1 0 = 0 1 0 1 0 0
  • Blank lines can be used so that programs are easier to read
  • Java programs must have at least one class declaration that is defined
  • A left brace indicates the beginning of the body of a class declaration
  • System.out allows Java application to display characters in the command window
  • Example
    • 1 0 0 1 1 1 0 - 1 0 0 1 1 0 = 1 0 0 1 0 1 0
  • Fill-in the missing text and command to run this program
    1. public class MyClass {
    2. public static void main(String[] args) {
    3. System.out.println("Hello World");
    4. }
    5. }
  • Martin Fowler: 'Any fool can write that a computer can understand. Good programmers write code that humans can understand'
  • Credits: This presentation template was created by Slidesgo, including icons by Flaticon, infographics & images by Freepik
  • Thank you, Rhanel M. Llenareses, SHS Teacher / SHS ICT Coordinator, for listening!
  • Keep safe and God bless!
  • Base
    The number of digits used in the numeral system
  • Binary number system
    • Uses only two digits, 0 and 1
    • Called base 2 number system
  • Octal number system
    • Uses 8 digits, 0 to 7
    • Called base-8 number system
  • Decimal system
    • Uses ten digits, 0 to 9
    • Called base-10
  • Hexadecimal system
    • Uses sixteen digits, 0 to 9, A to F
    • Called base-16
  • Subscript
    Denotes the base of the number or its number system
  • Converting Decimal system to other number system
    1. Divide the decimal number by the value of the new base
    2. Get the remainder as the rightmost digit of the new base number
    3. Divide the quotient by the new base
    4. Record the remainder as the next digit of the new base number
    5. Repeat until quotient becomes zero
  • Converting Decimal to Binary
    1. Divide the decimal number by 2
    2. Get the remainder as the rightmost digit
    3. Divide the quotient by 2
    4. Get the remainder as the next digit
    5. Repeat until quotient becomes zero
  • Converting Decimal 95 to Binary
    • 95 ÷ 2 = 47, remainder 1
    • 47 ÷ 2 = 23, remainder 1
    • 23 ÷ 2 = 11, remainder 1
    • 11 ÷ 2 = 5, remainder 1
    • 5 ÷ 2 = 2, remainder 1
    • 2 ÷ 2 = 1, remainder 0
    • 1 ÷ 2 = 0, remainder 1
    • Binary: 10111112
  • Converting Decimal 65 to Octal
    • 65 ÷ 8 = 8, remainder 1
    • 8 ÷ 8 = 1, remainder 0
    • 1 ÷ 8 = 0, remainder 1
    • Octal: 1018
  • Converting Decimal 103 to Octal
    • 103 ÷ 8 = 12, remainder 7
    • 12 ÷ 8 = 1, remainder 4
    • 1 ÷ 8 = 0, remainder 1
    • Octal: 1478
  • Converting Decimal 95 to Hexadecimal
    • 95 ÷ 16 = 5, remainder 15
    • 5 ÷ 16 = 0, remainder 5
    • Hexadecimal: 5F16
  • Converting Decimal 109 to Hexadecimal
    • 109 ÷ 16 = 6, remainder 13
    • 6 ÷ 16 = 0, remainder 6
    • Hexadecimal: 6D16
  • Converting Binary to Decimal
    1. Determine the positional value of each binary digit
    2. Multiply each binary digit by 2 raised to its positional value
    3. Add up all the results
  • Converting Binary 1011111 to Decimal

    • 1 x 20 = 1
    • 1 x 21 = 2
    • 1 x 22 = 4
    • 1 x 23 = 8
    • 1 x 24 = 16
    • 0 x 25 = 0
    • 1 x 26 = 64
    • Total: 95
  • Converting Binary to Octal
    1. Group binary digits into sets of 3
    2. Write placeholders 4, 2, 1 under each set
    3. Write 1 or 0 under each placeholder based on binary digit
    4. Add digits in each set of 3