|
|
zadach400.BAS |
|
{* Задача400 *}REM basic' Дан набор стройматериалов, каждый из которых характеризуется типом(перекрытие, балка, панель, опора), материалом (бетон, дерево, кирпич, камень) и ценой в рублях. Найти общую стоимость изделий одного типа. Для каждого типа построить столбиковую гистограмму распределения цен по материалам. CLS SCREEN 12 INPUT "kolichestvo stroimeterialov-"; k Dim iz$(k) Dim t(k) Dim m(k) Dim s(k) For i = 1 To k 1 CLS PRINT "material -"; i; "/"; k PRINT "tipi materialov(v skobke index, ykazivat pri vvode materialov):" PRINT "perekrytie(1), balka(2), panel(3), opora(4)" PRINT "material(v skobke index, ykazivat pri vvode materialov):" PRINT "beton(1), derevo(2), kirpich(3), kamen (4)" INPUT "(izdelie)"; iz$(i) 21 INPUT "tip"; t(i) If t(i) 1 And t(i) 2 And t(i) 3 And t(i) 4 Then GoTo 21 22 INPUT "material"; m(i) If m(i) 1 And m(i) 2 And m(i) 3 And m(i) 4 Then GoTo 22 23 INPUT "stoimost"; s(i) If s(i) < 0 Then GoTo 23 PRINT "izdelie -"; iz$(i); "; tip -"; t(i); "; material -"; m(i); "; stoimost -"; s(i) 3 INPUT "dannie verni ?(Y/N)"; yn$ If yn$ = "Y" Or yn$ = "y" Then GoTo 2 If yn$ = "N" Or yn$ = "n" Then GoTo 1 If (yn$ "Y" And yn$ "N") Or (yn$ "y" And yn$ "n") Then GoTo 3 2 PRINT Next i For i = 1 To k If t(i) = 1 Then stoim1 = stoim1 + s(i) If t(i) = 2 Then stoim2 = stoim2 + s(i) If t(i) = 3 Then stoim3 = stoim3 + s(i) If t(i) = 4 Then stoim4 = stoim4 + s(i) Next i sredstoim = (stoim1 + stoim2 + stoim3 + stoim4) / 4 If sredstoim 330 And sredstoim 660 And sredstoim 1320 And sredstoim 2640 And sredstoim 5000 And sredstoim 10000 Then kof = .07 For i = 1 To k If t(i) = 1 And m(i) = 1 Then s11 = (s11 + s(i)) * kof If t(i) = 1 And m(i) = 2 Then s12 = (s12 + s(i)) * kof If t(i) = 1 And m(i) = 3 Then s13 = (s13 + s(i)) * kof If t(i) = 1 And m(i) = 4 Then s14 = (s14 + s(i)) * kof If t(i) = 2 And m(i) = 1 Then s21 = (s21 + s(i)) * kof If t(i) = 2 And m(i) = 2 Then s22 = (s22 + s(i)) * kof If t(i) = 2 And m(i) = 3 Then s23 = (s23 + s(i)) * kof If t(i) = 2 And m(i) = 4 Then s24 = (s24 + s(i)) * kof If t(i) = 3 And m(i) = 1 Then s31 = (s31 + s(i)) * kof If t(i) = 3 And m(i) = 2 Then s32 = (s32 + s(i)) * kof If t(i) = 3 And m(i) = 3 Then s33 = (s33 + s(i)) * kof If t(i) = 3 And m(i) = 4 Then s34 = (s34 + s(i)) * kof If t(i) = 4 And m(i) = 1 Then s41 = (s41 + s(i)) * kof If t(i) = 4 And m(i) = 2 Then s42 = (s42 + s(i)) * kof If t(i) = 4 And m(i) = 3 Then s43 = (s43 + s(i)) * kof If t(i) = 4 And m(i) = 4 Then s44 = (s44 + s(i)) * kof Next i CLS PRINT "tipi materialov(stolbec):" PRINT "perekrytie(1), balka(2)" PRINT "panel(3), opora(4)" PRINT "material:" PRINT "beton(beliy), derevo(jeltiy)" PRINT "kirpich(krasniy), kamen (golub)" For i = 1 To k PRINT i; ":"; iz$(i); "-"; t(i); "-"; m(i); "-"; s(i); Next i LOCATE 1, 54: PRINT "gistogramma" LINE (335, 25)-(335, 350), 4 LINE (335, 350)-(625, 350), 4 LINE (340, 349)-(390, 349 - s11), 15, BF LINE (340, 349 - s11)-(390, 349 - s11 - s12), 14, BF LINE (340, 349 - s11 - s12)-(390, 349 - s11 - s12 - s13), 4, BF LINE (340, 349 - s11 - s12 - s13)-(390, 349 - s11 - s12 - s13 - s14), 3, BF LINE (395, 349)-(445, 349 - s21), 15, BF LINE (395, 349 - s21)-(445, 349 - s21 - s22), 14, BF LINE (395, 349 - s21 - s22)-(445, 349 - s21 - s22 - s23), 4, BF LINE (395, 349 - s21 - s22 - s23)-(445, 349 - s21 - s22 - s23 - s24), 3, BF LINE (450, 349)-(500, 349 - s31), 15, BF LINE (450, 349 - s31)-(500, 349 - s31 - s32), 14, BF LINE (450, 349 - s31 - 32)-(500, 349 - s31 - s32 - s33), 4, BF LINE (450, 349 - s31 - s32 - s33)-(500, 349 - s31 - s32 - s33 - s34), 3, BF LINE (555, 349)-(505, 349 - s41), 15, BF LINE (555, 349 - s41)-(505, 349 - s41 - s42), 14, BF LINE (555, 349 - s41 - s42)-(505, 349 - s41 - s42 - s43), 4, BF LINE (555, 349 - s41 - s42 - s43)-(505, 349 - s41 - s42 - s43 - s44), 3, BF End 07.08.2014 - Breakpoint - точка остановки 07.08.2014 - Топ-10 самых популярных приложений в Facebook 18.11.2013 - Панель управления и персонализация системы. Windows Vista 18.11.2013 - Логические и физические диски. Windows Vista 18.11.2013 - Удаление файлов и папок 01.11.2013 - Программирование дисковых подсистем: возможности 31.10.2013 - Windows8 или Windows7? 31.10.2013 - Windows8, игры |
|
Non-commercial fansite
|