Thank you

for choosing Habsida.

for choosing Habsida.

Now you only need to complete the JS Admission Task Challenge!

A Admission Task Challenge is a necessary requirement when choosing the "Pay after employment" plan. After completing the task, the coordinator will contact you and invite for an admission interview.

The start of the next course is May 15.

Get you spot!

Get you spot!

Days

Hours

Minutes

Seconds

Here's what you need to do:

1

Admission Task Challenge

Create the "Calculator" app with easy-to-follow guidelines.

2

Interview

After completing the task, we'll arrange a stress-free admission interview.

3

Education

In just 6-8 months, you'll be ready for a successful career as a Developer

4

IT Career

With your industry portfolio and interview skillset ready, you'll be on your way to a thriving IT career!

- You will need to solve a code problem in JavaScript.
- Task link: https://repl.it/@JavaMentor/RomanCalculator
- After solving the problem, save the link to the solution (copy the url).

Create a calculate function. The function must accept arithmetic operations of two numbers as a string and return a string with the result of their execution.

The function takes data from arguments and returns with return.

- The solution must pass all tests.
- The calculator can perform addition, subtraction, multiplication and division operations with two numbers: a + b, a - b, a * b, a / b. The data is transferred as a single line!
- The calculator can work with both Arabic (1,2,3,4,5…) and Roman (I,II,III,IV,V…) numbers. Both operands must be either Arabic or Roman.
- The operands must be in the range 1 to 10 inclusive, no zero. The answer may be more than 10.
- The calculator can only work with integers, accepts and returns.
- The output result is always a string with an integer. In division, we take into account only the integer part - we discard the decimal part, for example 2 / 4 \u003d 0.5 - we return 0.
- The calculator can only work with Arabic or Roman numerals at the same time, when the user enters a string like 3 + II, the calculator should throw an exception (error) and stop working.
- Since there are no zero and negative numbers in the Roman numeral system, we return an empty string instead. (for example I - II = '')
- When calling the calculator with inappropriate numbers, the function throws an exception and exits.
- When calling the calculator with a string that is not a math example with one of the arithmetic operations described in the requirement, the application throws an exception and exits.

```
calculate('1 + 2'); // string '3' will be returned
calculate('VI / III'); // return string 'II'
calculate('VII / III'); // return string II'
calculate('I + II'); // return string 'III'
calculate('I - II'); // return string '' (empty string) there are no negative numbers in the roman system
calculate('I + 1'); // an exception (error) will be returned throws Error different number systems are used at the same time
calculate('I'); // throws Error exception will be returned. string is not a mathematical operation
calculate('1 + 1 + 1'); // throws Error exception will be returned. the format of the mathematical operation does not satisfy the task - two operands and one operator (+, -, /, *)
```

Step 1

- You need to register or login on the platform https://replit.com/
- Follow the link https://repl.it/@JavaMentor/RomanCalculator and click the “Fork” button to start solving the problem

Step 2

After clicking the "run" button, your code will be tested. The test results will be printed to the console. The console can contain both a success message and an error message. You need to write code that passes all the tests.

Error case

All tests passed case

- You must solve the problem on your own, without anyone's help.
- You can use Google, but do not look for a ready-made solution to the problem.

- The solution is saved on the platform under a unique url, which will need to be sent to us at info@schoice.co with the subject “Front-end test task”

Struggling? We've got you covered!

We offer a free crash course to get you started in Java from scratch.

Check out the list of topics whose study will help with the task:

- Data Types
- Variables
- Array and object methods
- Data type conversion (from string to number and back)
- Operations with numbers (rounding, division, etc.)
- Error handling, exception throwing
- Types of errors in JS and what they mean
- Functions
- Loops, comparison, conditional if-else and switch-case constructs
- Logical operators

Side-by-side code snippets - comparison of code examples in different languages. You can choose your language and JS to study similarities / differences.

If this is the first program you are trying to write - try to practice the basics on simpler problems.

Try to break a large task into small subtasks and solve them separately - it's much easier. Or simplify the problem to a variant that you can solve, and then refine it to the specified requirements.

Try to break a large task into small subtasks and solve them separately - it's much easier. Or simplify the problem to a variant that you can solve, and then refine it to the specified requirements.

You must send in your admission test by October 23.