Java training #2

The Purpose of this training is to get familiar with:

  • Strings and some of their methods and behaviors
  • Basic work with Arrays
  1. Get a sentence as an input from the user and print to the screen each word of the sentence in a different line

  2. Get a sentence as an input and print the reversed sentence.
    Example:
    Input: hello world
    Output: world hello

  3. Get a sentence as an input and print to the screen:
        The number of words in the sentence
        The number of times that the letter ‘a’ appears,
        The number of times that the letter ‘f’ exists
        The number of commas in the sentence

  4. Get a sentence as an input and a number as an input. and do the following
    Example 1:
    Input: Hello world 3
    Output:
     hel
     lo
    wor
    ld

    Example 2:
    Input: taltaltal 3
    Output:
    tal
    tal
    tal

Note: In the examples above, the number 3 means => 3 letters will be print each time. space can be considered as letter  character.

Java training #1

The Purpose of this training is to get familiar with:

  • Numbers and simple calculations
  • For loops
  • If statements
  • Switch case statements
  • Reading input from the user (console) and writing output back to the screen

  1. Create a program that gets a number as an input from the user and calculates the sum of all the numbers from 1 till the input number.

  2. Create a program that gets 2 numbers as an input from the user and a string as an action (“add”, “subtract”, “multiply”, “divide”) and prints the outcome of the relevant action.
  3. Create a program that gets a number as an input from the user and prints to the screen the factorial of the number, and weather this number is primary or not.

Note: These are calculation exercises – no need for fancy classes and objects– We’ll get to that later.

Speaking the language

“An investment in knowledge always pays the best interest”
Benjamin Franklin


We”ll be discussing mainly software and coding.

But In fact, it doesn’t really matters what your current heart wish is..
Sports, Playing an instrument, Writing, painting, drawing, reading, Fitness, sculpting, coding or just about anything.. first, you should be able to speak the language.

Speaking the language changes everything, it brings you from novice to moderate to expert and by doing so it beams you up you to an entirely different place you didn’t imagine possible.

The following series of posts are for absolute code beginners who might have other experience in the software world (QA, Services) but want to get some basic “practical” experience in coding.
I’m using double quotes here due to the fact that practical is an interesting word, how can solving a basic coding exercise gives practical experience..? 

From some reason we have forgotten the basic eternal truth of Elementary school – “practice makes perfect”. and when practicing well enough, we might find out that the real world is sometime the same as our exercises, and sometimes it’s easier…