Skip to content

KurinAlex/ASD-Lab1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms and data structures - Lab 1

Write programs to perform 5 different types of tasks:

  1. elementary operators
  2. conditional operators
  3. cycles
  4. arrays
  5. 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>
  1. Find the distance between the points 𝐴 (𝑥1, 𝑦1) and 𝐵 (𝑥2, 𝑦2) on the plane.
  2. 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.
  3. Organize an endless loop until the user enters 0 from the keyboard, then display how many attempts it took.
  4. Given an array of real numbers of size 16 elements which will be: 𝑎0, ..., 𝑎15. Find 𝑚𝑎𝑥(𝑎0 - 𝑎8, 𝑎1 - 𝑎9, ..., 𝑎7 - 𝑎15).
  5. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published