0% found this document useful (0 votes)
15 views

Lab 1 Input, Output, Variables, Datatypes, Arithmetic Operation

The document provides examples of mathematical operations and programming problems involving variables, functions, arithmetic operations, and geometric shapes. Some key examples include: - Finding the perimeter and area of basic shapes like squares and rectangles given side lengths - Calculating volumes and surface areas of rectangular prisms - Evaluating functions for a given value of x - Writing programs to get user input, perform calculations on numbers like finding digits sums, and converting between time formats - Sorting values and finding sums, differences, products, and other operations on real numbers - Calculating distances between points and perimeters of triangles given coordinate values

Uploaded by

ndaupbaeva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Lab 1 Input, Output, Variables, Datatypes, Arithmetic Operation

The document provides examples of mathematical operations and programming problems involving variables, functions, arithmetic operations, and geometric shapes. Some key examples include: - Finding the perimeter and area of basic shapes like squares and rectangles given side lengths - Calculating volumes and surface areas of rectangular prisms - Evaluating functions for a given value of x - Writing programs to get user input, perform calculations on numbers like finding digits sums, and converting between time formats - Sorting values and finding sums, differences, products, and other operations on real numbers - Calculating distances between points and perimeters of triangles given coordinate values

Uploaded by

ndaupbaeva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Input and output, assignment operator

1. Given side of a square a. Find its perimeter P = 4 a and area S = a2.


2. The sides of a rectangle are equal to a and b. Find its area S = a b and perimeter P = 2(a + b).
3. Give the lengths of edges a, b, c of a rectangular parallelepiped. Find its volume V = a b c and surface area
S = 2 (a b + b c + a c).
4. Two non-negative numbers a and b are given. Find their geometric mean, which is the square root of their
product: √𝑎 𝑏.
5. The cathets of a right triangle a and b are given. Find the hypotenuse c and the perimeter P: 𝑐 = √𝑎! + 𝑏 ! ,
𝑃 = 𝑎 + 𝑏 + 𝑐.
6. The variables A, B, C are given. Change their values by changing the values of the variables A to B, B to C,
and C to A, and output the new values of the variables A, B, C.
7. The variables A, B, C are given. Change their values by changing the values of the variables from A to C, C
to B, B to A, and output the new values of the variables A, B, C.
8. Find the value of the function 𝑦 = 3𝑥 " − 6 𝑥 ! + 7 for a given value of x.
9. Find the value of the function 𝑦 = 4(𝑥 − 3)" + 7(𝑥 − 2)# + 2 for a given value of x.
10. Write a program that asks the user to enter his/her name. The program should respond with a message that
says hello to the user using his/her name.
11. Create a program that reads a four-digit integer from the user and displays the sum of the digits in that
number. For example, if the user enters 3141, your program should display 3+1+4+1=9.
12. Create a program that asks the user for a number. Your program should then output the equivalent amount
of time for that number in the form D:HH:MM:SS, where D, HH, MM and SS mean days, hours, minutes
and seconds, respectively.
13. The days of the week are numbered as follows: 0 - Sunday, 1 - Monday, 2 - Tuesday, : : : , 6 - Saturday. The
integer K is in the range 1-365. Determine the number of the day of the week for the K-th day of the year, if
it is known that January 1 was Monday this year.
14. Sort 3 values a, b, c entered by the user into increasing order.
15. The real numbers a, b, c, d are given. Get their sum, difference and product.
x+ y
16. The real numbers x and y are given. Get .
1 + xy
17. An edge length of a cube is given. Find the volume of the cube and the area of its side surface.
18. Two positive real numbers are given. Find the arithmetic mean and geometric mean of these numbers.
x -1 - 3 y
19. x, y, z are given. Calculate a, b, if a = 2 2
, b = x (arctg z + e -( x +3) );
x y
1+ +
2 4
3 + e y -1 ( y - x) 2
y-x
3

20. x, y, z are given. Calculate a, b, if a = , b = 1+ y - x + + ;


1 + x 2 y - tgZ 2 3
x + y / ( x 2 + 4) 1 + cos( y - 2)
21. x, y, z are given. Calculate a, b, if a = (1 + y )- x -2
, b= 4 ;
e + 1 / ( x + 4)
2
x / 2 + sin 2 Z
x æ zö
22. x, y, z are given. Calculate a, b, if a = y + , b = ç 1 + tg 2 ÷ ;
x 2 è 2ø
y2 +
y+x /3 3

2 cos( x - p / 6) z2
23. x, y, z are given. Calculate a, b, if a = , b = 1+ ;
1 / 2 + sin 2 y 3 + z2 / 5
1 + sin 2 ( x + y) æ 1ö
24. x, y, z are given. Calculate a, b, if a = + x , b = cos2 ç arctg ÷ ;
2 + x - 2 x / (1 + x y 2 2 è zø
(
25. x, y, z are given. Calculate a, b, if a = ln y - )æ
x çx -
è
y ö
÷
z + x 2 / 4ø
; b = x -
x2 x5
+ .
3! 5!

32. Calculate the distance d between two points with coordinates x1, y1 and x2, y2, where
d=4(𝑥1 − 𝑥2)! + (𝑦1 − 𝑦2)!
33. A triangle is given by the coordinates of its vertices. Find the perimeter of the triangle.

You might also like