Skip to content

Michael-Kolbasov/epam-javacore

Repository files navigation

EPAM Java Core Training 2018

Repo for homework

Task #1 Traffic light

Solution

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.

Task #2 Strings

Solution

Given a word. Output its:

  1. third symbol;
  2. last symbol;
  3. K-th symbol;
  4. Given a sentence. Find the amount of identical adjacent symbols in it;
  5. Given a word. Flip its second and fifth letters;
  6. Enter a sentence from keyboard. Flip its letters. Example: this code is great -> siht edoc si taerg.

Task #3 Arrays of Arrays

Solution

  1. Print a string made of four characters from corners of an array (in any order).
  2. Write a program that prints a word, built by symbols of several following indexes from some line of an array.
  3. 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.
  4. Print words, built by even elements of every array row.
  5. Print words, built by odd elements of every array column.

Task #4 Recursion

Solution

  1. Write a recursive function for calculating factorial of a natural number N;
  2. Write a recursive function for calculating power A of a real number N (N - natural number);
  3. Write a recursive function: a) for calculating sum of digits of a natural number; b) for calculating amount of digits of a natural number.

Task #5 ATM

Solution

Create a thread-safe Automated Teller Machine.

Task #6 Lambda

Solution

Create a functional interface and use it with lambda expression.

Task #7 Sea Battle

Solution

Create a Sea Battle game using Maven, Factory pattern and AI. 2D version.

Task #8 Algorithms

Solution

Create a realization of the following algorithms:

  1. Bubble sort
  2. Binary search
  3. Merge sort
  4. Radix sort
  5. Quick sort

Task #9 Hippodrome

Solution

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.

About

Homework for courses

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages