Write programs to perform 5 different types of tasks:
- elementary operators
- conditional operators
- cycles
- arrays
- functions
Check the correct operation of programs with different input data.
In tasks where any variables are entered, it is desirable to implement their setting via data entry from the terminal (eg cin). In tasks with arrays it is recommended to fill them with random numbers (rand () function).
Importantly! Allowed libraries to connect:
- I / O libraries: <iostream>, <iomanip>, <stdio.h>, <conio.h>
- library of mathematical functions: <cmath> (math.h)
- libraries for the randomize function: <cstdlib> (stdlib.h), <ctime> (time.h)
- library to support Cyrillic output: <clocale> (locale.h)
- library for support of Ukrainian letters in the Windows console: <windows.h>
- Find the distance between the points 𝐴 (𝑥1, 𝑦1) and 𝐵 (𝑥2, 𝑦2) on the plane.
- The coordinates of point x and y are given. Check that it lies on the coordinate axis Ox or Oy and display a message about it.
- Organize an endless loop until the user enters 0 from the keyboard, then display how many attempts it took.
- Given an array of real numbers of size 16 elements which will be: 𝑎0, ..., 𝑎15. Find 𝑚𝑎𝑥(𝑎0 - 𝑎8, 𝑎1 - 𝑎9, ..., 𝑎7 - 𝑎15).
- Set the mathematical function 𝑓(𝑥) = 𝑥3 - 2𝑥2 + 𝑥 - 1 as a function. Find the maximum value of the function on the segment [-3, 4], search to perform withstep 0.5.