kaje11 / JavaExercises

Java exercises I had to make for my Java classes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaExercises

Java exercises I had to do for my Java classes. The source of the exercises are unknown, although most of them can be found here: http://www.jkozak.pl/przedmioty-ue/programowanie-java/ The author of this site is probably also the author of the tasks.

List of exercises

polishLearningJavaOne

Source

  1. Celsius to Fahrenheit conversion
  2. Read 3 numbers from input and output the biggest and the smallest
  3. Rate body mass with BMI
  4. Count the tax
  5. Count the installment plan
  6. Simple calculator

polishLearningJavaTwo - Control structures and loops

Source

  1. Get an unsigned integer and output all of the uneven numbers below it
  2. Read a and b from input and output sum from a, a+1...b using while, do while and for
  3. Read an unsigned integer and write all of the powers of two below the number
  4. Read numbers from input until 0 and print out a sum of them
  5. Read numbers from input until 0 and print the biggest, the smallest and an average of these
  6. Game 'too high, too low'. Guess the number
  7. Read x, y, a, b, c where (x,y) is the position of the corner of a rectangle with size of (a,b) filled with c character
  8. Read an integer x from input and output a spruce with x levels
  9. Read an integer and print out sum of the digits and an average of them
  10. Print divisors of an integer
  11. Check if a number is prime

polishLearningJavaThree - Arrays

Source 6th task source

  1. Generate a random array and print the biggest, the smallest element, the average etc.
  2. Generate a random array with numbers from range 1-10 and count the occurences
  3. Create a matrix with random integers and print the biggest and the smallest numbers from the columns
  4. Print a number in binary with a negative sign
  5. Print a matrix with print numbers (see description)
  6. See description

polishLearningJavaFour - Strings

Source

  1. Read a string from input and write out number of repetition of the last character
  2. Reverse given string
  3. Check if given string is a palindrome
  4. Sum digits found in given string
  5. Check if the parentheses in given string are well constructed
  6. Encrypt given string with Caesar Cipher

polishLearningJavaFive - Strings and functions

Source

  1. Write iterative and recursive versions of factorial
  2. Write iterative and recursive versions of fibonacci
  3. Method returning position of given character in string
  4. Flip case of a string - make lowercase uppercase and vice versa
  5. Method checking if given string starts with second string
  6. Convert string to integer (see description).
  7. Same as Ex. 3 but with given string
  8. Count words in given string
  9. Split a string by whitespace
  10. Count occurences of a string in given string
  11. Cut a part of string and return the result
  12. See description
  13. Change character order with given integer array
  14. Check if a string is an anagram of another
  15. Convert hex to RGB array

polishLearningJavaSix - Text files

Source

  1. Count words, characters and whitespaces in given file
  2. Print lines to a file which contains given term
  3. See description
  4. Encrypt and decrypt a file with caesar cipher
  5. See description
  6. Convert text table to HTML table
  7. Create a chart of letter frequency from a file

polishLearningJavaSeven - Binary files

  1. Print 10 numbers to a file, reverse them and read them.
  2. PGM grid generator

polishLearningJavaEight - Classes

Source

See description

About

Java exercises I had to make for my Java classes.

License:MIT License


Languages

Language:Java 100.0%