The Parser for Math Expressions
To run you need to input in the console
java CalcMath your_expression
Ex.: java CalcMath 2 + 2 * 2
The output will be the result of the operations: 2 + 2 * 2 = 6
if data is corect and Wrong input
otherwise.- Possible operations
- + Addition
- - subtraction
- * Multiplication
- / Division
- () Brackets are also possible
- Unary Operations
Some other features:
- Possibility to write decimals starting with "." , ex.:
.125
- Possibility not to add "*" sign before brackets
Finding Max Min and other operations with Arrays
- In main function User need to input number of operation you'd like to run.
- #1 Finds max and min of random array. Input - array's length.
- #2 Finds max and min in each row of n-dimention array.
- #3 #2 and change max and min of each row between each other.
- #4 Exit. Stops running.
Additional functions written :
*
round(double num, int scale)
- returns double rounded by scale numbers after the dot.*
maxMinArray(Array)
- returns array of { index_of_max , index_of_min } of the given simple arrayMultiplication of two Matrix
Multiplication of Matrix of any dimentions(possible for operations)
Input: 4 integers: dim of 1st matrix &dim of 2nd matrix
Output: Matrix - result of computation.
Additional functions written :
*
round(double num, int scale)
- returns double rounded by scale numbers after the dot.*
makeArray(int num1, int num2)
- returns random array of given dimentions*
multipl(double[][] a, double[][] b)
- returns array - result of multiplication of two args givenParsing all links of the given web-page
This programm reads the source of the web-page and finds all the links. NOTE: Won't find any
mailto
links which were specially securely generated with js still..Input: Valid URL string
Output: List of all href links at the page + number of links of each type
A simple simulation of a zoo. This zoo will have enclosures of animals that are looked after by zookeepers. The animals will eat food, produce waste and have special treats to keep them healthy.
For more info about the task, please, visit this link.
Input: name of the file with basic data in the proper format
Example
zoo:
steak:50
enclosure:50
hay:20
celery:10
lion:M,12,5
bear:F,10,4
playZookeeper:
Output: Description of all activities at each Enclosure of each Zoo made by Animal or Zookeper. Continue till there is not empty (has animals) operatable Enclosure.
NOTE: Java Documentation created for this project and can be found in this folder
NOTE: OR Comments also can be helpful for understanding every class/method/variable definition
Comparison the time of basic methods for ArrayList and LinkedList of Integers.
Output:
Below you can see the output of the programm in comfortable view. We compare
get()
, set()
, add()
, remove()
to be continued..