Java Training Course/Example Programs: Difference between revisions

From tehowiki
Jump to navigation Jump to search
imported>Gfis
V1
 
imported>Gfis
No edit summary
Line 1: Line 1:
====Start with a greeting====
===Start with a greeting===
* '''HelloWorld''' - output only
* '''HelloWorld''' - output only
====Elementary String and arithmetic operations===
===Arguments, assignment, elementary String and arithmetic operations===
* '''StringAdd''' - concatenate argument strings 4 times and print them out
* '''StringAdd''' - concatenate argument strings 4 times and print them out
* '''IntAdd''' - add 4 integers 4 times and print them
* '''IntAdd''' - add 4 integers 4 times and print them
* '''IntMultiply''' - multiply 4 integers 4 times and print the product
* '''IntMultiply''' - multiply 4 integers 4 times and print the product
* '''LongMultiply''' - multiply 4 long numbers
* '''LongMultiply''' - multiply 4 long numbers
===Loops (<code>while, for</code>) and conditions (<code>if</code>)===
* '''PowersOf2''' - print the powers of 2
* '''PowersOf2''' - print the powers of 2
** '''PowersOf2Check''' - check for increasing sequence
** '''PowersOf2Check''' - check for increasing sequence
** '''PowersOf2Backwards''' - print sequence backwards
** '''PowersOf2Backwards''' - print sequence backwards
===Arrays===
** '''PowersOf2Array''' - print sequence from an array
** '''PowersOf2Array''' - print sequence from an array

Revision as of 08:20, 13 November 2017

Start with a greeting

  • HelloWorld - output only

Arguments, assignment, elementary String and arithmetic operations

  • StringAdd - concatenate argument strings 4 times and print them out
  • IntAdd - add 4 integers 4 times and print them
  • IntMultiply - multiply 4 integers 4 times and print the product
  • LongMultiply - multiply 4 long numbers

Loops (while, for) and conditions (if)

  • PowersOf2 - print the powers of 2
    • PowersOf2Check - check for increasing sequence
    • PowersOf2Backwards - print sequence backwards

Arrays

    • PowersOf2Array - print sequence from an array