denisovch
09.01.2023 05:14

Labwork №1. 1)Write a program that calculates a volume of a cylinder.

Forex:

Radius (centimeters) = 5.5

Height of cylinder (cm) = 7

Result:

Volume of the cylinder is 665.23 cm.cube.

2)Write a program that calculates a total surface of a cylinder.

Forex:

Radius (centimeters) = 5.5

Height of cylinder (cm) = 7

Result:

Total surface of the cylinder is: 431.97 cm. square.

3)Write a program that converts pounds into kilograms. (1 pound = 405.9 grams)

Forex:

Enter weight in pounds = 5

Result:

5 pounds = 2.05 kg.

4)Write a program that calculates of series and parallel resistances in electricity.

Forex:

Enter values of R1 and R2 resistances:

R1 = 10 Ohm

R2 = 6 Ohm

Result:

Series resistances R1 and R2 is: 16 Ohm

Parallel resistances R1 and R2 is: 3.75 Ohm

5)Write a program that calculates ampere of electricity if resistance and voltage are given.

Forex:

Enter values of V(voltage) and R (resistance) of electricity:

V = 220 volt

R = 11Ohm

Result:

I = 20 Ampere

6)Write a program that calculates a distance between points given in map if there are 120 kilometers in one centimeter of point.

Forex:

Enter the distance of points in map (in centimeters) : 120

Result:

Then the real distance is : 1440 km.

7)Write a program that calculates a cost of journey with a car.

Forex:
Distance from point A to point B(in km) : 67 km

Car’s fuel consumption for 100 km: 10 litters

Cost of a fuel (92 or 93 type): 110 tenge

Result:

Total cost of journey there and back: 1474 tenge

8)Write a program that calculates a speed of a person who runs some distance.

Forex:

Enter a distance (meters) = 1000 m.

Enter a time he spent to run (mins and seconds) = 3.25

(3.25 = 3 мin 25 sec = 205 sec)

Result:

His speed is = 17.56 km/hour

○чень нужн●!П̰о̰ж̰а̰л̰у̰й̰с̰т̰а̰

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
karina072006
05.01.2023 16:18

32768

Объяснение:

Данная незамысловатая функция Excel VBA формирует строку, согласно условию.

Function replstr(str As String, n As Integer) As String

Dim a(1 To 3), b(1 To 3) As String, i, j As Integer

a(1) = "A": a(2) = "B": a(3) = "AB"

b(1) = "AB": b(2) = "AB": b(3) = "A"

For i = 1 To n

j = (i - 1) Mod 3 + 1

str = Replace(str, a(j), b(j))

Next

replstr = str

End Function

Аргументы функции:

1) Исходная строка (а данном случае “AA”)

2) Число операций с исходной строкой

Значение первых 13 операций:

=replstr("AA";1) ABAB

=replstr("AA";2) AABAAB

=replstr("AA";3)

=replstr("AA";4) ABABABAB

=replstr("AA";5) AABAABAABAAB

=replstr("AA";6)

=replstr("AA";7) ABABABABABABABAB

=replstr("AA";8) AABAABAABAABAABAABAABAAB

=replstr("AA";9)

=replstr("AA";10)

=replstr("AA";11)

=replstr("AA";12)

=replstr("AA";13)

Для подсчета символов “A” в строке, используем еще одну функцию:

Function chrcount(str1 As String, str2 As String) As Integer

Dim str() As String

str = Split(str1, str2)

chrcount = UBound(str, 1)

End Function

Аргументы функции:

1) Cтрока

2) Символ (последовательность символов), число которых требуется найти

Например, результатом использования функции =chrcount(replstr("AA";20);"A") в ячейке Excel будет число 256

Используя описанные функции, посчитаем символы “A”в первых 13 строках

Номер операции (i) Число символов “A” в строке

1    2

2    4

3    4

4    4

5    8

6    8

7    8

8    16

9    16

10    16

11    32

12    32

13    32

Как видно из таблицы, число символов в строке образует числовую последовательность 2^1;  2^2; 2^2; 2^2; 2^3; 2^3; 2^3; … 2^([(i-2)/3]+2)

Таким образом, мы получили формулу для вычисления числа символов “A”в строке по номеру операции.

Соответственно, 2^([(43-2)/3]+2) = 32768

0,0(0 оценок)
Ответ:
ксюня264
28.01.2020 17:46
1) a:=x div 100 (в переменную а присваивается переменная x деленная на 100 без остатка, по другому a= x/100 без остатка, a=125/100= 1.25 b ,и берем только 1, a=1 )
2) b:=x mod 100 div 10 (в переменную b присваивается переменная x деленная на 100 b и берется остаток, а потом число которое получилось делиться на 10 и берется только целая часть,b = 125/100=1,25 берем только 25, 25/10=2,5 берем целую часть то есть 2, b=2 )
3) c:=x mod 10 (в переменную с присваивается переменная x деленная на 10, по другому с= x/10 без остатка, с=125/10= 12,5 b ,и берем только 5, с = 5)
4) s:=a *b*с=1*2*5=10
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота