Methodical material. Parsing the topic of c++ pointers. Writing assignments and tests for students
- ✅ Write a function that takes the side of a square as arguments and returns its perimeter, area, and diagonal. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/1.cpp
Lines 1 to 16 in 60f02be
- ✅ Write a function that takes three sides of a triangle as arguments and returns its perimeter and area. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/2.cpp
Lines 1 to 15 in e5cfa15
- ✅ Write a function that takes the radius of the circle as arguments and returns its area and the length of the arc. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/3.cpp
Lines 1 to 16 in e5cfa15
- ✅ Write a function that takes the legs of a right triangle as arguments and returns its angles. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/4.cpp
Lines 1 to 16 in e5cfa15
- ✅ Write a function that takes three sides of a parallelepiped as arguments and returns its volume and surface area. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/5.cpp
Lines 1 to 16 in e5cfa15
- ✅ Write a function that takes two numbers as arguments and returns the greatest and least common divisors. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/6.cpp
Lines 1 to 25 in e5cfa15
- ✅ Write a function that takes the legs of a right triangle as arguments and returns the value of the hypotenuse, the radius of the inscribed and circumscribed circle. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/7.cpp
Lines 1 to 16 in e5cfa15
- ✅ Write a function that takes the height and radius of the cylinder as arguments, and returns its volume and surface area. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/8.cpp
Lines 1 to 16 in e5cfa15
- ✅ Write a function that takes two numbers as arguments and returns a reduced fraction (25 15, 5/3). Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/9.cpp
Lines 1 to 22 in e5cfa15
- ✅ Write a function that takes three sides of a triangle as arguments and returns the perimeter of the triangle and the area calculated using the Heron formula. Write a program to demonstrate how this function works.
Material-Pointer-Cpp/Source/Pointers/10.cpp
Lines 1 to 16 in 041c44a
- ❌ Write a function that takes the value of the acute angle of a right-angled triangle and the length of the hypotenuse as arguments, and returns the length of the legs, the area of the triangle and the radius of the circumscribed circle. Write a program to demonstrate how this function works.
- ❌ Write a function that takes the base of an isosceles trapezoid as arguments and returns the perimeter, area and height of the trapezoid. Write a program to demonstrate how this function works.
- ❌ Write a function that takes age (number of years) as an argument and returns the number of months, days, hours and minutes lived.
- ❌ Write a function that takes as an argument the value of the first and second elements of an arithmetic progression and returns the difference of this progression, the 15th element and the sum of its first 50 members.
- ❌ Write a function that takes as an argument the value of the first and second element of a geometric progression and returns the denominator of this progression, the 15th element and the sum of its first 50 members.
- ✅ Write a program that generates a dynamic array of all primes before N and displays them on the screen.
Material-Pointer-Cpp/Source/Dynamic arrays/1.cpp
Lines 1 to 26 in e5cfa15
- ✅ Write a program that, given a natural number n, prints all its prime natural divisors, taking into account the multiplicity. The running time of the program must be proportional to the root of n.
Material-Pointer-Cpp/Source/Dynamic arrays/2.cpp
Lines 1 to 27 in e5cfa15
- ✅ Given a number N. Form a dynamic array consisting of the first N Fibonacci numbers (recall that they are given by the recurrent formula Fn = Fn-1 + Fn-2, F1 = F2 = 1).
Material-Pointer-Cpp/Source/Dynamic arrays/3.cpp
Lines 1 to 19 in e5cfa15
- ❌ Given an array of integers, consisting of N elements. Fill it out from the keyboard. Count the number of odd elements before the minimum, if there are several of them, form a new array of them.
- ✅ Given an array consisting of N elements and an array consisting of M elements. Fill them out from the keyboard. Create an array consisting of the positive elements of the input arrays.
Material-Pointer-Cpp/Source/Dynamic arrays/5.cpp
Lines 1 to 29 in e5cfa15
- ✅ Given an array consisting of N elements and an array consisting of M elements. Fill them out from the keyboard. Create an array consisting of even elements of the input arrays.
Material-Pointer-Cpp/Source/Dynamic arrays/6.cpp
Lines 1 to 29 in e5cfa15
- ✅ Given an array of N elements. Create a new array consisting of the positive elements of the input array.
Material-Pointer-Cpp/Source/Dynamic arrays/7.cpp
Lines 1 to 22 in e5cfa15
- ✅ Given an array of N elements. Create a new array consisting of the negative elements of the input array.
Material-Pointer-Cpp/Source/Dynamic arrays/8.cpp
Lines 1 to 22 in e5cfa15
- ❌ Given a dynamic array, the size of which is entered from the keyboard. Fill the array with random numbers. Remove K elements from it, starting from the middle of the array.
- ❌ Write a program that creates a dynamic array and remove an element from the number N from it, add K elements, starting from the number N. N is entered from the keyboard
- ✅ Given an array of integers, consisting of N elements. Fill it out from the keyboard. Create an array consisting of elements whose values are greater than the value of the previous element (starting from the second).
Material-Pointer-Cpp/Source/Dynamic arrays/11.cpp
Lines 1 to 22 in 626accb
- ✅ Given an array consisting of N elements and an array consisting of M elements. Fill them out from the keyboard. Find the minimum in the array N, and the maximum in the array M. Form an array consisting of N array elements preceding the minimum element and M array elements following the maximum.
Material-Pointer-Cpp/Source/Dynamic arrays/12.cpp
Lines 1 to 41 in 626accb
- ✅ Change the dynamic array of integers so that its positive elements become negative and vice versa.
Material-Pointer-Cpp/Source/Dynamic arrays/13.cpp
Lines 1 to 17 in 626accb
- ✅ Given an array consisting of N elements and an array consisting of M elements. Fill them in with random numbers. Create an array consisting of the positive elements of the N array and the negative elements of the M array.
Material-Pointer-Cpp/Source/Dynamic arrays/14.cpp
Lines 1 to 29 in 626accb
Material-Pointer-Cpp/Source/Dynamic arrays/14_random.cpp
Lines 1 to 24 in 626accb
- ❌ Given an array consisting of N elements and an array consisting of M elements. Fill them in with random numbers. Create an array consisting of prime numbers of arrays N and M. The numbers in the new array cannot be repeated.