Tasks studies - laboratory
Discuss conditional statements in C++. Provide an example of program code using one of them.
Discuss types of loops in C++. Provide an example of program code using one of them.
Write a program code/algorithm that calculates the arithmetic mean of two integers entered by the user.
Write a program/algorithm that calculates the value of ๐^๐
for the entered positive integers ๐ and ๐. Do not use instructions from mathematical libraries, e.g. cmath.
Write a program that reads user-supplied integers into an n-element array (n supplied by the user) and calculates the average of the array elements that are divisible by 2.
Describe the operation of the following function
double function1(double a, double b, unsigned n)
{
double variable1;
if (b == 1)
return n*a;
else
{
variable1 = a * (1 - pow(b, n))/(1 - b);
return variable1;
}
}
What value will it return when we call it with arguments (2, 1, 9).
Operations on arrays, entering data into an array and performing operations on elements of the array. For example, write the code of a program that will enter ๐ real elements into an array and calculate their average. The number ๐ and the elements to be entered are provided by the user
Write a program/algorithm that determines the values โโof a sequence given by a recursive formula.
Describe the method of exchanging information between a program and a function
What is an algorithm, ways of presenting it, features of an algorithm.
File type.
Variables โ types, other types given in class