Inputoutput and assignment
Begin1°. Given the side a of a square, find the perimeter P of the square: P = 4·a.
Begin2°. Given the side a of a square, find the area S of the square: S = a^{2}.
Begin3°. The sides a and b of a rectangle are given. Find the area S = a·b and the perimeter P = 2·(a + b) of the rectangle.
Begin4°. Given the diameter d of a circle, find the length L of the circle: L = π·d. Use 3.14 for a value of π.
Begin5°. Given the edge a of a cube, find the volume V = a^{3} and the surface area S = 6·a^{2} of the cube.
Begin6°. The edges a, b, c of a right parallelepiped are given. Find the volume V = a·b·c and the surface area S = 2·(a·b + b·c + a·c) of the right parallelepiped.
Begin7°. Given the radius R of a circle, find the length L of the circumference and the area S of the circle: L = 2·π·R, S = π·R^{2}. Use 3.14 for a value of π.
Begin8°. Given two numbers a and b, find their average: (a + b)/2.
Begin9°. Given two nonnegative numbers a and b, find their geometrical mean (a square root of their product): (a·b)^{1/2}.
Begin10°. Two nonzero numbers are given. Find the sum, the difference, the product, and the quotient of their squares.
Begin11°. Two nonzero numbers are given. Find the sum, the difference, the product, and the quotient of their absolute values.
Begin12°. The legs a and b of a right triangle are given. Find the hypotenuse c and the perimeter P of the triangle: c = (a^{2} + b^{2})^{1/2}, P = a + b + c.
Begin13°. Given the radiuses R_{1} and R_{2} of two concentric circles (R_{1} > R_{2}), find the areas S_{1} and S_{2} of the circles and the area S_{3} of the ring bounded by the circles: S_{1} = π·(R_{1})^{2}, S_{2} = π·(R_{2})^{2}, S_{3} = S_{1} − S_{2}. Use 3.14 for a value of π.
Begin14°. Given the length L of a circumference, find the radius R and the area S of the circle. Take into account that L = 2·π·R, S = π·R^{2}. Use 3.14 for a value of π.
Begin15°. Given the area S of a circle, find the diameter D and the length L of the circumference. Take into account that L = π·D, S = π·D^{2}/4. Use 3.14 for a value of π.
Begin16°. Two points with the coordinates x_{1} and x_{2} are given on the real axis. Find the distance between these points: x_{2} − x_{1}.
Begin17°. Three points A, B, C are given on the real axis. Find the length of AC, the length of BC, and the sum of these lengths.
Begin18°. Three points A, B, C are given on the real axis, the point C is located between the points A and B. Find the product of the length of AC and the length of BC.
Begin19°. The coordinates (x_{1}, y_{1}) and (x_{2}, y_{2}) of two opposite vertices of a rectangle are given. Sides of the rectangle are parallel to coordinate axes. Find the perimeter and the area of the rectangle.
Begin20°. The coordinates (x_{1}, y_{1}) and (x_{2}, y_{2}) of two points are given. Find the distance between the points: ((x_{2} − x_{1})^{2} + (y_{2} − y_{1})^{2})^{1/2}.
Begin21°. The coordinates (x_{1}, y_{1}), (x_{2}, y_{2}), (x_{3}, y_{3}) of the triangle vertices are given. Find the perimeter and the area of the triangle using the formula for distance between two points in the plane (see Begin20). The area of a triangle with sides a, b, c can be found by Heron formula: S = (p·(p − a)·(p − b)·(p − c))^{1/2}, where p = (a + b + c)/2 is the halfperimeter.
Begin22°. Exchange the values of two given variables A and B. Output the new values of A and B.
Begin23°. Variables A, B, C are given. Change values of the variables by moving the given value of A into the variable B, the given value of B into the variable C, and the given value of C into the variable A. Output the new values of A, B, C.
Begin24°. Variables A, B, C are given. Change values of the variables by moving the given value of A into the variable C, the given value of C into the variable B, and the given value of B into the variable A. Output the new values of A, B, C.
Begin25°. Given an independent variable x, find the value of a function y = 3x^{6} − 6x^{2} − 7.
Begin26°. Given an independent variable x, find the value of a function y = 4(x−3)^{6} − 7(x−3)^{3} + 2.
Begin27°. Given a number A, compute a power A^{8} using three multiplying operators for computing A^{2}, A^{4}, A^{8} sequentially. Output all obtained powers of the number A.
Begin28°. Given a number A, compute a power A^{15} using five multiplying operators for computing A^{2}, A^{3}, A^{5}, A^{10}, A^{15} sequentially. Output all obtained powers of the number A.
Begin29°. The angle value α in degrees (0 ≤ α < 360) is given. Convert this value into radians. Take into account that 180° = π radians. Use 3.14 for a value of π.
Begin30°. The angle value α in radians (0 ≤ α < 2·π) is given. Convert this value into degrees. Take into account that 180° = π radians. Use 3.14 for a value of π.
Begin31°. A Fahrenheit temperature T is given. Convert it into a centigrade temperature. The centigrade temperature T_{C} and the Fahrenheit temperature T_{F} are connected as: T_{C} = (T_{F} − 32)·5/9.
Begin32°. A centigrade temperature T is given. Convert it into a Fahrenheit temperature. The centigrade temperature T_{C} and the Fahrenheit temperature T_{F} are connected as: T_{C} = (T_{F} − 32)·5/9.
Begin33°. X kg of sweet cost A euro. Find the cost of 1 kg and Y kg of the sweets (positive numbers X, A, Y are given).
Begin34°. X kg of chocolates cost A euro and Y kg of sugar candies cost B euro (positive numbers X, A, Y, B are given). Find the cost of 1 kg of the chocolates and the cost of 1 kg of the sugar candies. Also determine how many times the chocolates are more expensive than the sugar candies.
Begin35°. A boat velocity in still water is V km/h, river flow velocity is U km/h (U < V). The boat goes along the lake during T_{1} h and then goes against stream of the river during T_{2} h. Positive numbers V, U, T_{1}, T_{2} are given. Find the distance S covered by the boat (distance = time · velocity).
Begin36°. The velocity of the first car is V_{1} km/h, the velocity of the second car is V_{2} km/h, the initial distance between the cars is S km. Find the distance between the cars after T hours provided that the distance is increasing. The required distance is equal to a sum of the initial distance and the total distance covered by the both cars (total distance = time · total velocity).
Begin37°. The velocity of the first car is V_{1} km/h, the velocity of the second car is V_{2} km/h, the initial distance between the cars is S km. Find the distance between the cars after T hours provided that at the start time the distance is decreasing. This distance is equal to an absolute value of a difference between the initial distance and the total distance covered by the both cars.
Begin38°. Solve a linear equation A·x + B = 0 with given coefficients A and B (A is not equal to 0).
Begin39°. Solve a quadratic equation A·x^{2} + B·x + C = 0 with given coefficients A, B, C (A and the discriminant of the equation are positive). Output the smaller equation root and then the larger one. Roots of the quadratic equation may be found by formula x_{1, 2} = (−B ± (D)^{1/2})/(2·A), where D = B^{2} − 4·A·C is a discriminant.
Begin40°. Solve a system of linear equations A_{1}·x + B_{1}·y = C_{1}, A_{2}·x + B_{2}·y = C_{2} with given coefficients A_{1}, B_{1}, C_{1}, A_{2}, B_{2}, C_{2} provided that the system has the only solution. Use the following formulas: x = (C_{1}·B_{2} − C_{2}·B_{1})/D, y = (A_{1}·C_{2} − A_{2}·C_{1})/D,
where D = A_{1}·B_{2} − A_{2}·B_{1}.
