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
○чень нужн●!П̰о̰ж̰а̰л̰у̰й̰с̰т̰а̰
var
ar: array of integer;
n, k2, k3, k4, k5, i: integer;
r: real;
begin
write('Сколько учеников?');
readln(n);
setlength(ar, n);
writeln('Введите оценки:');
for i := 0 to n - 1 do
begin
readln(ar[i]);
case ar[i] of
2: inc(k2);
3: inc(k3);
4: inc(k4);
5: inc(k5);
else
writeln('Не оценка');
exit;
end;
end;
writeln('2:', k2);
writeln('3:', k3);
writeln('4:', k4);
writeln('5:', k5);
write('Успеваемость=', (k3 + k4 + k5) / n * 100:0:1);
end.
Пример ввода:
Сколько учеников?6
Введите оценки:
2
2
3
4
5
5
Пример вывода:
2:2
3:1
4:1
5:2
Успеваемость=66.7