Create a traffic light that outputs a signal colour. You enter a minute (from zero to n) and get a current signal light. First two minutes is red light, next three minutes is yellow and last five minutes is green.
Given a word. Output its:
- third symbol;
- last symbol;
- K-th symbol;
- Given a sentence. Find the amount of identical adjacent symbols in it;
- Given a word. Flip its second and fifth letters;
- Enter a sentence from keyboard. Flip its letters. Example: this code is great -> siht edoc si taerg.
- Print a string made of four characters from corners of an array (in any order).
- Write a program that prints a word, built by symbols of several following indexes from some line of an array.
- Given a two-dimensional array 5 * 5, filled with letters. Print a word, built by array elements marked with stars while reading them: A) Left to right in every row, B) Up to down in every column.
- Print words, built by even elements of every array row.
- Print words, built by odd elements of every array column.
- Write a recursive function for calculating factorial of a natural number N;
- Write a recursive function for calculating power A of a real number N (N - natural number);
- Write a recursive function: a) for calculating sum of digits of a natural number; b) for calculating amount of digits of a natural number.
Create a thread-safe Automated Teller Machine.
Create a functional interface and use it with lambda expression.
Create a Sea Battle game using Maven, Factory pattern and AI. 2D version.
Create a realization of the following algorithms:
- Bubble sort
- Binary search
- Merge sort
- Radix sort
- Quick sort
Create a hippodrome. Player makes a bet on a horse. Horses have their own constant speed and random acceleration speed. Each running horse represents a unique thread, so that all horses run in a parallel fashion.