ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² написании студСнчСских Ρ€Π°Π±ΠΎΡ‚
АнтистрСссовый сСрвис

Π”Π²ΠΎΠΈΡ‡Π½Ρ‹ΠΉ сумматор. 
ΠžΠ±ΡƒΡ‡Π°ΡŽΡ‰Π°Ρ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ°

ΠšΡƒΡ€ΡΠΎΠ²Π°ΡΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΠΈΠ£Π·Π½Π°Ρ‚ΡŒ ΡΡ‚ΠΎΠΈΠΌΠΎΡΡ‚ΡŒΠΌΠΎΠ΅ΠΉ Ρ€Π°Π±ΠΎΡ‚Ρ‹

If (label16. Text == «1» && label17. Text == «1») {timer5. Enabled = true; lineShape37. BorderColor = Color. LimeGreen; lineShape36. BorderColor = Color. LimeGreen; lineShape35. BorderColor = Color. LimeGreen; lineShape4. BorderColor = Color. LimeGreen; lineShape2. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor… Π§ΠΈΡ‚Π°Ρ‚ΡŒ Π΅Ρ‰Ρ‘ >

Π”Π²ΠΎΠΈΡ‡Π½Ρ‹ΠΉ сумматор. ΠžΠ±ΡƒΡ‡Π°ΡŽΡ‰Π°Ρ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° (Ρ€Π΅Ρ„Π΅Ρ€Π°Ρ‚, курсовая, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ)

ЦСлью ΠΌΠΎΠ΅ΠΉ курсовой Ρ€Π°Π±ΠΎΡ‚Ρ‹ Π±Ρ‹Π»ΠΎ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ ΠΎΠ±ΡƒΡ‡Π°ΡŽΡ‰ΡƒΡŽ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡƒ ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Ρ… сумматорах, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡŽΡ‰ΡƒΡŽ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŽ ΠΏΠΎΠ½ΡΡ‚ΡŒ ΠΏΡ€ΠΈΠ½Ρ†ΠΈΠΏ Ρ€Π°Π±ΠΎΡ‚Ρ‹ Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Ρ… сумматоров, Π° Ρ‚Π°ΠΊΠΆΠ΅ Π½Π°ΡƒΡ‡ΠΈΡ‚ΡŒΡΡ ΡΠΊΠ»Π°Π΄Ρ‹Π²Π°Ρ‚ΡŒ числа Π² Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠΉ систСмС счислСния. НСсомнСнно, Π²Π°ΠΆΠ½ΠΎΠΉ Ρ‡Π°ΡΡ‚ΡŒΡŽ любой ΠΎΠ±ΡƒΡ‡Π°ΡŽΡ‰Π΅ΠΉ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹ являСтся Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒ ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹Π΅ знания.

1. Основная Ρ‡Π°ΡΡ‚ΡŒ

1.1 ΠžΠΏΠΈΡΠ°Ρ‚Π΅Π»ΡŒΠ½Π°Ρ постановка Π·Π°Π΄Π°Ρ‡ΠΈ

Π’ ΡΠ²ΠΎΠ΅ΠΉ Ρ€Π°Π±ΠΎΡ‚Π΅ я ΠΏΠΎΡΡ‚Π°Ρ€Π°ΡŽΡΡŒ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ ΠΊΠ°Ρ‡Π΅ΡΡ‚Π²Π΅Π½Π½ΡƒΡŽ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡƒ, с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠΉ Ρ‡Π΅Π»ΠΎΠ²Π΅ΠΊ ΠΌΠΎΠΆΠ΅Ρ‚ Π½Π΅ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π½Π°ΡƒΡ‡ΠΈΡ‚ΡŒΡΡ ΡΠΊΠ»Π°Π΄Ρ‹Π²Π°Ρ‚ΡŒ числа Π² Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠΉ систСмС счислСния, Π½ΠΎ ΠΈ ΠΏΠΎΠ½ΡΡ‚ΡŒ, ΠΊΠ°ΠΊ Ρ€Π°Π±ΠΎΡ‚Π°ΡŽΡ‚ Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Π΅ сумматоры, Π° Ρ‚Π°ΠΊΠΆΠ΅ ΠΏΡ€ΠΎΡ‚Π΅ΡΡ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹Π΅ знания.

ПослСднСС врСмя всС Π±ΠΎΠ»Π΅Π΅ ΠΈΠ΄Π΅Ρ‚ тСндСнция Π½Π° «ΡΠ»Π΅ΠΊΡ‚Ρ€ΠΎΠ½Π½ΠΎΠ΅ ΠΎΠ±ΡƒΡ‡Π΅Π½ΠΈΠ΅». Π›ΡŽΠ΄ΠΈ ΡΠΊΠ°Ρ‡ΠΈΠ²Π°ΡŽΡ‚ ΠΎΠ±ΡƒΡ‡Π°ΡŽΡ‰ΠΈΠ΅ Ρ€ΠΎΠ»ΠΈΠΊΠΈ, ΠΎΠ±ΡƒΡ‡Π°ΡŽΡ‰ΠΈΠ΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, Π·Π°ΠΏΠΈΡΡ‹Π²Π°ΡŽΡ‚ΡΡ Π½Π° Π²Π΅Π±ΠΈΠ½Π°Ρ€Ρ‹ ΠΈ Ρ‚. Π΄. ΠžΠ±ΡƒΡ‡Π°ΡŽΡ‰Π°Ρ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° Ρ€Π΅ΡˆΠ°Π΅Ρ‚ Ρ‚Π°ΠΊΠΈΠ΅ слоТныС вопросы ΠΊΠ°ΠΊ:

1. ВрСмя обучСния. Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ Π²ΠΎΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒΡΡ ΠΎΠ±ΡƒΡ‡Π°ΡŽΡ‰Π΅ΠΉ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠΎΠΉ ΠΊΠΎΠ³Π΄Π° Ρ…ΠΎΡ‚ΠΈΡ‚Π΅ ΠΈ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒΡΡ Π΅ΠΉ ΡΠΊΠΎΠ»ΡŒΠΊΠΎ Π²Π°ΠΌ ΡƒΠ³ΠΎΠ΄Π½ΠΎ.

2. ΠŸΠΎΠ½ΡΡ‚Π½ΠΎΡΡ‚ΡŒ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ. Π Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΈ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌ ΡΡ‚Π°Ρ€Π°ΡŽΡ‚ΡΡ ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ Ρ‚Π°ΠΊ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Ρ‡Π΅Π»ΠΎΠ²Π΅ΠΊ, Π½Π΅ ΠΈΠΌΠ΅Ρ Π½ΠΈΠΊΠ°ΠΊΠΈΡ… Π·Π½Π°Π½ΠΈΠΉ, смог ΠΏΠΎΠ½ΡΡ‚ΡŒ ΠΏΡ€Π΅Π΄ΡΡ‚Π°Π²Π»Π΅Π½Π½ΡƒΡŽ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΡŽ.

3. ΠœΠ½ΠΎΠ³ΠΎΠΎΠ±Ρ€Π°Π·ΠΈΠ΅ Ρ€Π΅ΠΆΠΈΠΌΠΎΠ². ΠŸΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° ΠΌΠΎΠΆΠ΅Ρ‚ Π²ΠΊΠ»ΡŽΡ‡Π°Ρ‚ΡŒ Π² ΡΠ΅Π±Ρ ΠΊΠ°ΠΊ Ρ‚Π΅ΠΎΡ€Π΅Ρ‚ΠΈΡ‡Π΅ΡΠΊΡƒΡŽ Ρ‡Π°ΡΡ‚ΡŒ, Ρ‚Π°ΠΊ ΠΈ Ρ‚Ссты, задания, Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ, объяснСния ΠΈ Ρ‚. Π΄.

Π”Π²ΠΎΠΈΡ‡Π½Ρ‹ΠΉ сумматор — это элСктронная логичСская схСма, Π²Ρ‹ΠΏΠΎΠ»Π½ΡΡŽΡ‰Π°Ρ суммированиС Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Ρ… чисСл.

По ΡΠΏΠΎΡΠΎΠ±Ρƒ прСдставлСния ΠΈ ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ складываСмых чисСл многоразрядныС сумматоры ΠΏΠΎΠ΄Ρ€Π°Π·Π΄Π΅Π»ΡΡŽΡ‚ΡΡ Π½Π°:

Β· ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹Π΅, Π² ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° чисСл вСдётся ΠΏΠΎΠΎΡ‡Π΅Ρ€Ρ‘Π΄Π½ΠΎ, разряд Π·Π° Ρ€Π°Π·Ρ€ΡΠ΄ΠΎΠΌ Π½Π° ΠΎΠ΄Π½ΠΎΠΌ ΠΈ Ρ‚ΠΎΠΌ ΠΆΠ΅ ΠΎΠ±ΠΎΡ€ΡƒΠ΄ΠΎΠ²Π°Π½ΠΈΠΈ;

Β· ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½Ρ‹Π΅, Π² ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… слагаСмыС ΡΠΊΠ»Π°Π΄Ρ‹Π²Π°ΡŽΡ‚ΡΡ ΠΎΠ΄Π½ΠΎΠ²Ρ€Π΅ΠΌΠ΅Π½Π½ΠΎ ΠΏΠΎ Π²ΡΠ΅ΠΌ разрядам, ΠΈ Π΄Π»Ρ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ разряда имССтся своё ΠΎΠ±ΠΎΡ€ΡƒΠ΄ΠΎΠ²Π°Π½ΠΈΠ΅.

Π‘Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅ чисСл Π² Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠΉ систСмС счислСния ΠΏΠΎΠ΄ΠΎΠ±Π½ΠΎ ΡΡƒΠΌΠΌΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡŽ Π² Π΄Π΅ΡΡΡ‚ΠΈΡ‡Π½ΠΎΠΉ систСмС.

Как Ρ‚ΠΎΠ»ΡŒΠΊΠΎ сумма разрядов Π² Π΄Π΅ΡΡΡ‚ΠΈΡ‡Π½ΠΎΠΉ систСмС становится большС ΠΈΠ»ΠΈ Ρ€Π°Π²Π½ΠΎΠΉ 10 (основанию систСмы счислСния) ΠΌΡ‹ Π΄Π΅Π»Π°Π΅ΠΌ пСрСнос Π² Π±ΠΎΠ»Π΅Π΅ ΡΡ‚Π°Ρ€ΡˆΠΈΠΉ разряд. Π’Π°ΠΊ ΠΈ Π² Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠΉ систСмС:

0+0=0;

0+1=1;

1+0=1;

1+1=0 ΠΈ ΠΏΠ΅Ρ€Π΅Π½ΠΎΡ Π² ΡΡ‚Π°Ρ€ΡˆΠΈΠΉ разряд 1. (1+1=2; 2=2 (основаниС систСмы); ΡΠΎΠ²Π΅Ρ€ΡˆΠ°Π΅Ρ‚ΡΡ пСрСнос Π² ΡΡ‚Π°Ρ€ΡˆΠΈΠΉ разряд).

1.2 Π¦Π΅Π»ΠΈ

1. ΠΠ°ΡƒΡ‡ΠΈΡ‚ΡŒΡΡ Π»ΡƒΡ‡ΡˆΠ΅ Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ со ΡΡ€Π΅Π΄ΠΎΠΉ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ Visual Studio 2012.

2. Π‘ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½ΠΎ Ρ€Π°Π·ΠΎΠ±Ρ€Π°Ρ‚ΡŒΡΡ Π² Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ях языка программирования C#.

3. ΠŸΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ знания, для дальнСйшСго обучСния Π½Π° Π΄Π°Π½Π½ΠΎΠΉ ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ

1.3 Π—Π°Π΄Π°Ρ‡ΠΈ

1. Π˜Π·ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΡŽ, ΠΊΠ°ΡΠ°ΡŽΡ‰ΡƒΡŽΡΡ Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Ρ… сумматоров. ΠŸΠΎΠ½ΡΡ‚ΡŒ ΠΏΡ€ΠΈΠ½Ρ†ΠΈΠΏ ΠΈΡ… Ρ€Π°Π±ΠΎΡ‚Ρ‹.

2. Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡƒ.

3. ΠŸΡ€ΠΎΡ‚Π΅ΡΡ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡƒ Π½Π° Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ ошибок.

2. О ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ΅

2.1 ОписаниС

ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹ΠΉ сумматор счислСниС

ΠŸΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° прСдставляСт собой ΠΎΠΊΠ½ΠΎ с ΡΠ»Π΅ΠΌΠ΅Π½Ρ‚Π°ΠΌΠΈ windows forms. Код Ρ€Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½ ΠΏΡ€ΠΈ ΠΏΠΎΠΌΠΎΡ‰ΠΈ языка программирования C#.

Π’ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ΅ прСдусмотрСно Π΄Π²Π° Ρ€Π΅ΠΆΠΈΠΌΠ° Ρ€Π°Π±ΠΎΡ‚Ρ‹: Ρ€Π΅ΠΆΠΈΠΌ обучСния ΠΈ Ρ€Π΅ΠΆΠΈΠΌ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ.

Π Π΅ΠΆΠΈΠΌ обучСния Π²ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ Π² ΡΠ΅Π±Ρ тСорСтичСский курс, графичСский ΠΈΠΌΠΈΡ‚Π°Ρ‚ΠΎΡ€ ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора, Π° Ρ‚Π°ΠΊΠΆΠ΅ сумматор Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Ρ… ΠΊΠΎΠ΄ΠΎΠ² с Π²Ρ‹Π²ΠΎΠ΄ΠΎΠΌ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Π½Π° ΡΠΊΡ€Π°Π½.

Π’ Ρ‚СорСтичСском курсС содСрТатся основныС понятия, связанныС с Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹ΠΌΠΈ сумматорами.

ГрафичСский ΠΈΠΌΠΈΡ‚Π°Ρ‚ΠΎΡ€ ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора прСдставляСт собой Π°Π½ΠΈΠΌΠΈΡ€ΠΎΠ²Π°Π½Π½ΡƒΡŽ схСму сумматора ΠΈ ΠΏΠΎΡˆΠ°Π³ΠΎΠ²Ρ‹Π΅ дСйствия. Π‘Ρ…Π΅ΠΌΠ° Ρ€Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π° Ρ‚Π°ΠΊΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΈ исходных Π΄Π°Π½Π½Ρ‹Ρ… происходила смСна внСшнСго Π²ΠΈΠ΄Π° схСмы ΠΈ Π°Π½ΠΈΠΌΠ°Ρ†ΠΈΠΈ.

Π‘ΡƒΠΌΠΌΠ°Ρ‚ΠΎΡ€ Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹Ρ… ΠΊΠΎΠ΄ΠΎΠ² с Π²Ρ‹Π²ΠΎΠ΄ΠΎΠΌ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ ΠΈΠΌΠΈΡ‚ΠΈΡ€ΡƒΠ΅Ρ‚ дСйствия Ρ‡Π΅Π»ΠΎΠ²Π΅ΠΊΠ° ΠΏΡ€ΠΈ вычислСнии Π² ΡΡ‚ΠΎΠ»Π±ΠΈΠΊ.

Π Π΅ΠΆΠΈΠΌ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ прСдставляСт собой ΠΎΠΊΠ½ΠΎ с ΡˆΠ΅ΡΡ‚ΡŒΡŽ ΠΏΡ€ΠΈΠΌΠ΅Ρ€Π°ΠΌΠΈ. Для Ρ‚ΠΎΠ³ΠΎ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π½Π°Ρ‡Π°Ρ‚ΡŒ Ρ‚Π΅ΡΡ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒΡΡ достаточно Π·Π°ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Π½ΡƒΠΆΠ½Ρ‹Π΅ поля ΠΈ Π½Π°ΠΆΠ°Ρ‚ΡŒ ΠΊΠ½ΠΎΠΏΠΊΡƒ «Π½Π°Ρ‡Π°Ρ‚ΡŒ тСстированиС». ПослС этого, ΠΏΡ€ΠΈ ΠΏΠΎΠΌΠΎΡ‰ΠΈ класса Random Π±ΡƒΠ΄ΡƒΡ‚ сгСнСрированы ΡˆΠ΅ΡΡ‚ΡŒ Π·Π°Π΄Π°Π½ΠΈΠΉ. ПослС ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎΠ³ΠΎ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ ΠΈ Π²Π²ΠΎΠ΄Π° ΠΎΡ‚Π²Π΅Ρ‚ΠΎΠ² Π² Ρ„ΠΎΡ€ΠΌΡƒ, Π½ΡƒΠΆΠ½ΠΎ Π½Π°ΠΆΠ°Ρ‚ΡŒ «Π·Π°Π²Π΅Ρ€ΡˆΠΈΡ‚ΡŒ тСстированиС», вслСдствиС Ρ‡Π΅Π³ΠΎ появится ΠΎΠΊΠ½ΠΎ с Ρ€Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚Π°ΠΌΠΈ. Π Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚Ρ‹ Ρ‚Π°ΠΊΠΆΠ΅ Π±ΡƒΠ΄ΡƒΡ‚ сохранСны Π² Ρ„Π°ΠΉΠ».

НаТав Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ «ΡΠΏΡ€Π°Π²ΠΊΠ°» ΠΌΠΎΠΆΠ½ΠΎ ΠΎΠ·Π½Π°ΠΊΠΎΠΌΠΈΡ‚ΡŒΡΡ с ΠΊΡ€Π°Ρ‚ΠΊΠΎΠΉ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠ΅ΠΉ ΠΎ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ΅ ΠΈ Ρ ΠΈΡΡ‚ΠΎΡ‡Π½ΠΈΠΊΠ°ΠΌΠΈ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ.

2.2 УкрупнСнная схСма ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°

На ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΉ Π±Π»ΠΎΠΊ-схСмС продСмонстрирована Ρ€Π°Π±ΠΎΡ‚Π° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. (схСма 1).

2.3 Π˜Π½Ρ‚Π΅Ρ€Ρ„Π΅ΠΉΡ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° ΠΈ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅

На Π³Π»Π°Π²Π½ΠΎΠΉ Ρ„ΠΎΡ€ΠΌΠ΅ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° располоТСны: Π΄Π²ΠΎΠΈΡ‡Π½Ρ‹ΠΉ сумматор с Π²Ρ‹Π²ΠΎΠ΄ΠΎΠΌ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ (слСва), тСорСтичСская Ρ‡Π°ΡΡ‚ΡŒ (справа), ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΎΠ΅ мСню (свСрху).

Рисунок 1 — главная Ρ„ΠΎΡ€ΠΌΠ° Рисунок 2 — Ρ€Π΅ΠΆΠΈΠΌ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ Π’ Ρ€Π΅ΠΆΠΈΠΌΠ΅ тСстирования ΠΏΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ Π½Π΅ ΠΏΠΎΡΠ²Π»ΡΡŽΡ‚ся Π΄ΠΎ Ρ‚Π΅Ρ… ΠΏΠΎΡ€, ΠΏΠΎΠΊΠ° ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ Π½Π΅ Π²Π²Π΅Π΄Π΅Ρ‚ Π΄Π°Π½Π½Ρ‹Π΅ Π² ΠΏΠΎΠ»Ρ «Π€.И.О.» ΠΈ «Π“Ρ€ΡƒΠΏΠΏΠ°». ΠŸΡ€ΠΈ Π·Π°ΠΏΡƒΡ‰Π΅Π½Π½ΠΎΠΌ тСстировании, любая ΠΏΠΎΠΏΡ‹Ρ‚ΠΊΠ° Π·Π°ΠΊΡ€Ρ‹Ρ‚ΡŒ Ρ„ΠΎΡ€ΠΌΡƒ приравниваСтся ΠΊ Π½Π°ΠΆΠ°Ρ‚ΠΈΡŽ ΠΊΠ½ΠΎΠΏΠΊΠΈ «Π·Π°Π²Π΅Ρ€ΡˆΠΈΡ‚ΡŒ тСстированиС», ΠΎ Ρ‡Π΅ΠΌ написано Π½Π° ΡΠ°ΠΌΠΎΠΉ Ρ„ΠΎΡ€ΠΌΠ΅. (Рис. 2)

ΠŸΡ€ΠΈ запускС графичСского ΠΈΠΌΠΈΡ‚Π°Ρ‚ΠΎΡ€Π° ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора открываСтся новая Ρ„ΠΎΡ€ΠΌΠ° (рис. 3). Π§Ρ‚ΠΎΠ±Ρ‹ Π½Π°Ρ‡Π°Ρ‚ΡŒ Π΄Π΅ΠΌΠΎΠ½ΡΡ‚Ρ€Π°Ρ†ΠΈΡŽ Ρ€Π°Π±ΠΎΡ‚Ρ‹ сумматора Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ввСсти исходныС Π΄Π°Π½Π½Ρ‹Π΅ Π² ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½Ρ‹Π΅ поля ΠΈ Π½Π°ΠΆΠ°Ρ‚ΡŒ ΠΊΠ½ΠΎΠΏΠΊΡƒ «Π½Π°Ρ‡Π°Ρ‚ΡŒ Π΄Π΅ΠΌΠΎΠ½ΡΡ‚Ρ€Π°Ρ†ΠΈΡŽ».

Π”Π°Π½Π½Ρ‹ΠΉ ΠΈΠΌΠΈΡ‚Π°Ρ‚ΠΎΡ€ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора позволяСт ΠΈΠ·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Ρ‡Π΅Ρ‚Ρ‹Ρ€Π΅ Π²Ρ…ΠΎΠ΄Π° Π΄Π°Π½Π½Ρ‹Ρ…. Π­Ρ‚ΠΎ сдСлано ΠΈΠ· ΡΠΎΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΉ Ρ‚ΠΎΠ³ΠΎ, Ρ‡Ρ‚ΠΎ Ρ‡Π΅Ρ‚Ρ‹Ρ€Π΅Ρ… Π²Ρ…ΠΎΠ΄ΠΎΠ² Π±ΡƒΠ΄Π΅Ρ‚ Π²ΠΏΠΎΠ»Π½Π΅ достаточно для дСмонстрации Ρ€Π°Π±ΠΎΡ‚Ρ‹ ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора.

Рисунок 3 — динамичСская схСма ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора.

Рисунок 4 — справка Π’ ΡΠΏΡ€Π°Π²ΠΊΠ΅ освСщСны основныС ΠΌΠΎΠΌΠ΅Π½Ρ‚Ρ‹ Π² Ρ€Π°Π±ΠΎΡ‚Π΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹. НиТС находится список источников ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ для тСорСтичСского курса. (рис. 4)

3. ВСстированиС

ΠŸΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° Π±Ρ‹Π»Π° протСстирована Π½Π° Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ ошибок ΠΈ Π½Π΅ΠΈΡΠΏΡ€Π°Π²Π½ΠΎΡΡ‚Π΅ΠΉ ΠΌΠΎΠΈΠΌΠΈ ΠΎΠ΄Π½ΠΎΠ³Ρ€ΡƒΠΏΠΏΠ½ΠΈΠΊΠ°ΠΌΠΈ. ВыявлСнныС ошибки Π±Ρ‹Π»ΠΈ исправлСны. На Π΄Π°Π½Π½Ρ‹ΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ‚ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π³ΠΎΡ‚ΠΎΠ²ΠΎ ΠΊ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½ΠΈΡŽ.

Π—Π°ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅

ΠΈ Π²Π²ΠΎΠ΄Ρ‹

Π’ ΡΠ²ΠΎΠ΅ΠΉ курсовой Ρ€Π°Π±ΠΎΡ‚Π΅, я ΠΏΠΎΡΡ‚арался ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ ΠΏΡ€ΠΎΡΡ‚ΡƒΡŽ, ΡƒΠ΄ΠΎΠ±Π½ΡƒΡŽ Π² ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½ΠΈΠΈ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡƒ обучСния. Π‘ΠΎΠ²ΠΎΠΊΡƒΠΏΠ½ΠΎΡΡ‚ΡŒ срСдств, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½Π½Ρ‹Ρ… мною, Π²ΠΏΠΎΠ»Π½Π΅ достаточно для понимания Ρ‚Π΅ΠΌΡ‹, прСдставлСнной Π² ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ΅.

Π Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° Π΄Π°Π½Π½ΠΎΠΉ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹ ΠΏΠΎΠ·Π²ΠΎΠ»ΠΈΠ»Π° ΠΌΠ½Π΅ Π±ΠΎΠ»Π΅Π΅ ΡƒΠ³Π»ΡƒΠ±Π»Π΅Π½Π½ΠΎ ΠΈΠ·ΡƒΡ‡ΠΈΡ‚ΡŒ тонкости программирования Π½Π° C#.

Π’. А. Павловская ΠŸΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ Π½Π° ΡΠ·Ρ‹ΠΊΠ΅ высокого уровня: ΡƒΡ‡Π΅Π±. пособиС /ΠŸΠ˜Π’Π•Π , 2007. — 427 с.

2 msdn.microsoft.com [Π­Π»Π΅ΠΊΡ‚Ρ€ΠΎΠ½Π½Ρ‹ΠΉ рСсурс]: ΠΈΠ½Ρ‚Π΅Ρ€Π½Π΅Ρ‚ — ΠΏΠΎΡ€Ρ‚Π°Π».

3 Chipnews.ru [Π­Π»Π΅ΠΊΡ‚Ρ€ΠΎΠ½Π½Ρ‹ΠΉ рСсурс]: ΠΈΠ½Ρ‚Π΅Ρ€Π½Π΅Ρ‚ — ΠΆΡƒΡ€Π½Π°Π». — Πœ. — Π Π΅ΠΆΠΈΠΌ доступа: http://www.chipnews.ru/html.cgi/arhiv/0002/stat-37.htm

ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ А

Листинг ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹

Главная Ρ„ΠΎΡ€ΠΌΠ° (Ρ€Π΅ΠΆΠΈΠΌ обучСния)

using System;

using System. Collections. Generic;

using System. ComponentModel;

using System. Data;

using System. Drawing;

using System. Linq;

using System. Text;

using System. Windows. Forms;

namespace WindowsFormsApplication4

{

public partial class Form1: Form

{

public Form1 ()

{

InitializeComponent ();

}

Form2 f2 = new Form2 ();

Form3 f3 = new Form3 ();

Form4 f4 = new Form4 ();

private void Π²Ρ‹Ρ…ΠΎΠ΄ToolStripMenuItem_Click (object sender, EventArgs e)

{

Close ();

}

private void button1_Click (object sender, EventArgs e)

{

try

{

label2. Text = ««;

label3. Text = ««;

string TB1 = ««, TB2 = ««, otv = ««;

int deistv = 0;

int Max = Math. Max (textBox1. Text. Length, textBox2. Text. Length);

int NULL = Math. Abs (textBox1. Text. Length — textBox2. Text. Length);

int[] ost = new int [Max + 1];

int[] x = new int [Max + 1];

int[] y = new int [Max + 1];

int[] otvet = new int [Max + 1];

for (int i = 0; i < NULL; i++)

if (textBox1. Text. Length > textBox2. Text. Length)

TB2 += 0;

else

TB1 += 0;

TB1 += textBox1. Text;

TB2 += textBox2. Text;

for (int i = Max; i > 0; i-)

{

x[i] = TB1 [i — 1] - 48;

y[i] = TB2 [i — 1] - 48;

ost[i] = 0;

}

label3. Text = «0″ + TB1 + „n+n“ +» 0″ + TB2;

for (int i = Max; i >= 0; i-)

(

deistv++; label2. Text += «n» + deistv +")";

if (x[i] == 1 && y[i] == 1) if (ost[i] == 0) {ost [i — 1] = 1; otvet[i] = 0; label2. Text += x[i] + «+» + y[i] + «=» + ost [i — 1] + «0″; } else {ost [i — 1] = 1; otvet[i] = 1; label2. Text += x[i] + „+“ + y[i] + „+остаток:“ + ost[i] + „=“ + otvet[i] +» «+ ost [i — 1]; }

else if (x[i] == 0 && y[i] == 1 || x[i] == 1 && y[i] == 0) if (ost[i] == 0) {otvet[i] = 1; label2. Text += x[i] + «+» + y[i] + «=» + otvet[i]; } else {ost [i — 1] = 1; otvet[i] = 0; label2. Text += x[i] + «+» + y[i] + «+ остаток:» + ost[i] + «=» + ost [i — 1] +" «+ otvet[i]; }

else if (x[i] == 0 && y[i] == 0) if (ost[i] == 0) {otvet[i] = 0; label2. Text += x[i] + «+» + y[i] + «=» + otvet[i]; } else {otvet[i] = 1; label2. Text += x[i] + «+» + y[i] + «+ остаток:» + ost[i] + «=» + otvet[i]; }

}

int bb = Max + 1;

for (int i = 0; i <= Max; i++)

otv += otvet[i]; label2. Text += «nΠΎΡ‚Π²Π΅Ρ‚:» + otv;

if (otv[0] == '0') otv = otv. Remove (0, 1);

textBox3. Text = otv;

}

catch {MessageBox. Show («Π½Π΅ΠΎΠΏΠΎΠ·Π½Π°Π½Π½ΠΎΠ΅ ΠΈΡΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅»);}

}

private void textBox1_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar==(char) Keys. D0||e. KeyChar==(char) Keys. D1|| (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

if (e. KeyChar == (char) Keys. Enter) button1. Focus ();

}

private void textBox2_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

if (e. KeyChar == (char) Keys. Enter) button1. Focus ();

}

private void Ρ€Π΅ΠΆΠΈΠΌΠŸΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈΠ—Π½Π°Π½ΠΈΠΉToolStripMenuItem_Click (object sender, EventArgs e)

{

panel4. Visible = false;

f2. ShowDialog ();

}

private void Ρ„Π°ΠΉΠ»ToolStripMenuItem_Click (object sender, EventArgs e)

{

Close ();

}

private void справкаToolStripMenuItem_Click (object sender, EventArgs e)

{

f3. ShowDialog ();

}

private void button3_Click (object sender, EventArgs e)

{

f4. ShowDialog ();

}

private void Form1_Activated (object sender, EventArgs e)

{

panel4. Visible = true;

}

private void button2_Click1 (object sender, EventArgs e)

{

f2. ShowDialog ();

}

}

}

Π Π΅ΠΆΠΈΠΌ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ Π·Π½Π°Π½ΠΈΠΉ

using System;

using System. Collections. Generic;

using System. ComponentModel;

using System. Data;

using System. Drawing;

using System. Linq;

using System. Text;

using System. Windows. Forms;

using System. IO;

namespace WindowsFormsApplication4

{

public partial class Form2: Form

{

public Form2 ()

{

InitializeComponent ();

}

string C = «5», C2= «5», C3= «5», C4= «5», C5= «5», C6= «5»;

private void button1_Click (object sender, EventArgs e)

{

try

{

if (textBox4. Text. Trim () == ««) MessageBox. Show («Π²Π²Π΅Π΄ΠΈΡ‚Π΅ Π€.И.О.»);

else

if (textBox5. Text. Trim () == ««) MessageBox. Show («Π²Π²Π΅Π΄ΠΈΡ‚Π΅ Π³Ρ€ΡƒΠΏΠΏΡƒ»);

else

{

groupBox1. Enabled = true;

textBox4. Enabled = false;

textBox5. Enabled = false;

button1. Enabled = false;

label2. Enabled = false;

label3. Enabled = false;

panel1. Visible = true;

panel2. Visible = true;

panel3. Visible = true;

panel4. Visible = true;

panel5. Visible = true;

panel6. Visible = true;

label10. Visible = true;

label11. Visible = true;

label12. Visible = true;

label13. Visible = true;

label13. Visible = true;

label14. Visible = true;

label15. Visible = true;

Random random = new Random ();

int a = random. Next (0, 100);

int b = random. Next (0, 100);

C = Convert. ToString (a + b, 2);

string value1 = Convert. ToString (a, 2);

string value2 = Convert. ToString (b, 2);

label5. Text = value1 + «n+n» + value2;

a = random. Next (0, 100);

b = random. Next (0, 100);

C2 = Convert. ToString (a + b, 2);

value1 = Convert. ToString (a, 2);

value2 = Convert. ToString (b, 2);

label6. Text = value1 + «n+n» + value2;

a = random. Next (0, 100);

b = random. Next (0, 100);

C3 = Convert. ToString (a + b, 2);

value1 = Convert. ToString (a, 2);

value2 = Convert. ToString (b, 2);

label7. Text = value1 + «n+n» + value2;

a = random. Next (0, 100);

b = random. Next (0, 100);

C4 = Convert. ToString (a + b, 2);

value1 = Convert. ToString (a, 2);

value2 = Convert. ToString (b, 2);

label1. Text = value1 + «n+n» + value2;

a = random. Next (0, 100);

b = random. Next (0, 100);

C5 = Convert. ToString (a + b, 2);

value1 = Convert. ToString (a, 2);

value2 = Convert. ToString (b, 2);

label4. Text = value1 + «n+n» + value2;

a = random. Next (0, 100);

b = random. Next (0, 100);

C6 = Convert. ToString (a + b, 2);

value1 = Convert. ToString (a, 2);

value2 = Convert. ToString (b, 2);

label8. Text = value1 + «n+n» + value2;

}

}

catch {MessageBox. Show («Π½Π΅ΠΎΠΏΠΎΠ·Π½Π°Π½Π°Ρ ошибка»);}

}

private void button2_Click (object sender, EventArgs e)

{

Close ();

}

private void textBox1_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox2_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox3_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void Form2_FormClosed (object sender, FormClosedEventArgs e)

{

try {

if (groupBox1. Enabled)

{

StreamWriter f = new StreamWriter (textBox5. Text + «» + textBox4. Text +". txt");

int verno = 0;

int ocenka = 0;

string errors = ««;

if (textBox1. Text == C) verno++; else errors += «1»;

if (textBox2. Text == C2) verno++; else errors += «2»;

if (textBox3. Text == C3) verno++; else errors += «3»;

if (textBox6. Text == C4) verno++; else errors += «4»;

if (textBox7. Text == C5) verno++; else errors += «5»;

if (textBox8. Text == C6) verno++; else errors += «6»;

f. WriteLine («ΡƒΡ‡Π°Ρ‰ΠΈΠΉΡΡ (яся):» + textBox4. Text);

f. WriteLine («Π³Ρ€ΡƒΠΏΠΏΠ°:» + textBox5. Text);

f. WriteLine («Π΄Π°Π½ΠΎ Π²Π΅Ρ€Π½Ρ‹Ρ… ΠΎΡ‚Π²Π΅Ρ‚ΠΎΠ²:» + verno);

f. WriteLine («ΠΎΡˆΠΈΠ±ΠΊΠΈ Π² Π½ΠΎΠΌΠ΅Ρ€Π°Ρ…:» + errors);

switch (verno)

{

case 6: ocenka = 5; break;

case 5: ocenka = 4; break;

case 4: ocenka = 4; break;

case 3: ocenka = 3; break;

case 2: ocenka = 2; break;

case 1: ocenka = 2; break;

case 0: ocenka = 2; break;

}

if (verno == 6) MessageBox. Show («Π²Π΅Ρ€Π½ΠΎ ΠΎΡ‚Π²Π΅Ρ‚ΠΎΠ² Π΄Π°Π½ΠΎ:» + verno + «n ΠΎΡ†Π΅Π½ΠΊΠ°:» + ocenka);

else

MessageBox. Show («Π²Π΅Ρ€Π½ΠΎ ΠΎΡ‚Π²Π΅Ρ‚ΠΎΠ² Π΄Π°Π½ΠΎ:» + verno + «n ΠΎΡ†Π΅Π½ΠΊΠ°:» + ocenka + «n ΠΎΡˆΠΈΠ±ΠΊΠΈ Π² Π½ΠΎΠΌΠ΅Ρ€Π°Ρ…:» + errors);

f. WriteLine («ΠΎΡ†Π΅Π½ΠΊΠ°:» + ocenka);

f. Close ();

Close ();

groupBox1. Enabled = false;

textBox4. Enabled = true;

textBox5. Enabled = true;

button1. Enabled = true;

label2. Enabled = true;

label3. Enabled = true;

label5. Text = ««;

label6. Text = ««;

label7. Text = ««;

label1. Text = ««;

label4. Text = ««;

label8. Text = ««;

textBox1. Text = ««;

textBox2. Text = ««;

textBox3. Text = ««;

textBox4. Text = ««;

textBox5. Text = ««;

textBox6. Text = ««;

textBox7. Text = ««;

textBox8. Text = ««;

panel1. Visible = false;

panel2. Visible = false;

panel3. Visible = false;

panel4. Visible = false;

panel5. Visible = false;

panel6. Visible = false;

label10. Visible = false;

label11. Visible = false;

label12. Visible = false;

label13. Visible = false;

label13. Visible = false;

label14. Visible = false;

label15. Visible = false;

}

else

{

textBox4. Text = ««;

textBox5. Text = ««;

}

} catch {MessageBox. Show («Π½Π΅ΠΎΠΏΠΎΠ·Π½Π°Π½Π½ΠΎΠ΅ ΠΈΡΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅»);}

}

private void textBox6_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;}

else e. Handled = true;

}

private void textBox7_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;}

else e. Handled = true;

}

private void textBox8_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;}

else e. Handled = true;

}

}

}

ГрафичСский ΠΈΠΌΠΈΡ‚Π°Ρ‚ΠΎΡ€ ΠΏΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎΠ³ΠΎ Π΄Π²ΠΎΠΈΡ‡Π½ΠΎΠ³ΠΎ сумматора

using System;

using System. Collections. Generic;

using System. ComponentModel;

using System. Data;

using System. Drawing;

using System. Linq;

using System. Text;

using System. Windows. Forms;

namespace WindowsFormsApplication4

{

public partial class Form4: Form

{

public Form4 ()

{

InitializeComponent ();

}

private void button1_Click (object sender, EventArgs e)

{

rectangleShape1. BackColor = Color. LimeGreen;

rectangleShape3. BackColor = Color. LimeGreen;

rectangleShape5. BackColor = Color. LimeGreen;

rectangleShape2. BackColor = Color. Red;

rectangleShape4. BackColor = Color. Red;

rectangleShape6. BackColor = Color. Red;

label1. BackColor = Color. LimeGreen;

label2. BackColor = Color. LimeGreen;

label3. BackColor = Color. LimeGreen;

label4. BackColor = Color. Red;

label5. BackColor = Color. Red;

label6. BackColor = Color. Red;

groupBox2. Visible = true;

button1. Enabled = false;

label27. Visible = true;

}

private void button4_Click (object sender, EventArgs e)

{

if (textBox1. Text. Length == 1 && textBox2. Text. Length == 1 && textBox3. Text. Length == 1 && textBox4. Text. Length == 1 && textBox5. Text. Length == 1 && textBox6. Text. Length == 1)

{

groupBox1. Visible = true;

groupBox1. Visible = true;

label14. Text = textBox1. Text;

label15. Text = textBox4. Text;

label16. Text = textBox2. Text;

label17. Text = textBox5. Text;

label18. Text = textBox3. Text;

label19. Text = textBox6. Text;

lineShape10. BorderColor = Color. Red;

lineShape9. BorderColor = Color. Red;

lineShape8. BorderColor = Color. Red;

lineShape11. BorderColor = Color. Red;

lineShape12. BorderColor = Color. Red;

lineShape13. BorderColor = Color. Red;

lineShape14. BorderColor = Color. Red;

lineShape15. BorderColor = Color. Red;

lineShape16. BorderColor = Color. Red;

lineShape17. BorderColor = Color. Red;

lineShape18. BorderColor = Color. Red;

lineShape21. BorderColor = Color. Red;

lineShape22. BorderColor = Color. Red;

lineShape25. BorderColor = Color. Red;

lineShape26. BorderColor = Color. Red;

lineShape6. BorderColor = Color. Black;

lineShape49. BorderColor = Color. Black;

lineShape38. BorderColor = Color. Black;

lineShape39. BorderColor = Color. Black;

lineShape40. BorderColor = Color. Black;

lineShape2. BorderColor = Color. Black;

lineShape4. BorderColor = Color. Black;

lineShape35. BorderColor = Color. Black;

lineShape36. BorderColor = Color. Black;

lineShape37. BorderColor = Color. Black;

button3. Enabled = false;

button5. Enabled = false;

groupBox4. Visible = false;

label20. Text= «Π‘Π•Π— Π˜Π—ΠœΠ•ΠΠ•ΠΠ˜Π™»;

label21. Text= «Π‘Π•Π— Π˜Π—ΠœΠ•ΠΠ•ΠΠ˜Π™»;

label22. Text = «Π‘Π•Π— Π˜Π—ΠœΠ•ΠΠ•ΠΠ˜Π™»;

if (label14. Text == «1») lineShape19. BorderColor = Color. LimeGreen; else lineShape19. BorderColor = Color. Red;

if (label15. Text == «1») lineShape20. BorderColor = Color. LimeGreen; else lineShape20. BorderColor = Color. Red;

if (label16. Text == «1») lineShape24. BorderColor = Color. LimeGreen; else lineShape24. BorderColor = Color. Red;

if (label17. Text == «1») lineShape23. BorderColor = Color. LimeGreen; else lineShape23. BorderColor = Color. Red;

if (label18. Text == «1») lineShape28. BorderColor = Color. LimeGreen; else lineShape28. BorderColor = Color. Red;

if (label19. Text == «1») lineShape27. BorderColor = Color. LimeGreen; else lineShape27. BorderColor = Color. Red;

lineShape41. BorderColor = Color. IndianRed; lineShape42. BorderColor = Color. IndianRed; lineShape43. BorderColor = Color. IndianRed; lineShape44. BorderColor = Color. IndianRed;

lineShape45. BorderColor = Color. IndianRed; lineShape48. BorderColor = Color. IndianRed; lineShape47. BorderColor = Color. IndianRed; lineShape46. BorderColor = Color. IndianRed;

button1. Enabled = true;

button2. Enabled = true;

groupBox2. Visible = false;

groupBox3. Visible = false;

label27. Visible = false;

}

else MessageBox. Show («Π²Π²Π΅Π΄ΠΈΡ‚Π΅ всС значСния Π²Ρ…ΠΎΠ΄ΠΎΠ²»);

}

int schot = 0;

private void button2_Click (object sender, EventArgs e)

{

lineShape41. BorderColor = Color. Green; lineShape42. BorderColor = Color. Green; lineShape43. BorderColor = Color. Green; lineShape44. BorderColor = Color. Green;

if (label14. Text == «1») {lineShape17. BorderColor = Color. LimeGreen; lineShape10. BorderColor = Color. LimeGreen; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; if (label1. BackColor == Color. LimeGreen) {label1. BackColor = Color. Red; rectangleShape1. BackColor = Color. Red; label4. BackColor = Color. LimeGreen; rectangleShape2. BackColor = Color. LimeGreen;} else {label1. BackColor = Color. LimeGreen; rectangleShape1. BackColor = Color. LimeGreen; label4. BackColor = Color. Red; rectangleShape2. BackColor = Color. Red;}} else {label20. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape10. BorderColor = Color. Red; lineShape9. BorderColor = Color. Red; lineShape8. BorderColor = Color. Red;}

if (label16. Text == «1») {lineShape21. BorderColor = Color. LimeGreen; lineShape11. BorderColor = Color. LimeGreen; lineShape12. BorderColor = Color. LimeGreen; lineShape13. BorderColor = Color. LimeGreen; label21. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; if (label2. BackColor == Color. LimeGreen) {label2. BackColor = Color. Red; rectangleShape3. BackColor = Color. Red; label5. BackColor = Color. LimeGreen; rectangleShape4. BackColor = Color. LimeGreen;} else {label2. BackColor = Color. LimeGreen; rectangleShape3. BackColor = Color. LimeGreen; label5. BackColor = Color. Red; rectangleShape4. BackColor = Color. Red;}} else {label21. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape11. BorderColor = Color. Red; lineShape12. BorderColor = Color. Red; lineShape13. BorderColor = Color. Red;}

if (label18. Text == «1») {lineShape25. BorderColor = Color. LimeGreen; lineShape14. BorderColor = Color. LimeGreen; lineShape16. BorderColor = Color. LimeGreen; lineShape15. BorderColor = Color. LimeGreen; label22. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; if (label3. BackColor == Color. LimeGreen) {label3. BackColor = Color. Red; rectangleShape5. BackColor = Color. Red; label6. BackColor = Color. LimeGreen; rectangleShape6. BackColor = Color. LimeGreen;} else {label3. BackColor = Color. LimeGreen; rectangleShape5. BackColor = Color. LimeGreen; label6. BackColor = Color. Red; rectangleShape6. BackColor = Color. Red;}} else {label22. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape14. BorderColor = Color. Red; lineShape16. BorderColor = Color. Red; lineShape15. BorderColor = Color. Red;}

timer2. Enabled = true;

groupBox3. Visible = true;

button2. Enabled = false;

}

private void timer2_Tick (object sender, EventArgs e)

{

switch (schot)

{

case 1: {lineShape19. BorderWidth = 5; lineShape24. BorderWidth = 5; lineShape28. BorderWidth = 5; break;}

case 2: {lineShape19. BorderWidth = 3; lineShape24. BorderWidth = 3; lineShape28. BorderWidth = 3; rectangleShape10. BorderWidth = 5; rectangleShape12. BorderWidth = 5; rectangleShape14. BorderWidth = 5; break;}

case 3: {rectangleShape10. BorderWidth = 1; rectangleShape12. BorderWidth = 1; rectangleShape14. BorderWidth = 1; lineShape17. BorderWidth = 5; lineShape21. BorderWidth = 5; lineShape25. BorderWidth = 5; break;}

case 4: {lineShape17. BorderWidth = 2; lineShape21. BorderWidth = 2; lineShape25. BorderWidth = 2; rectangleShape7. BorderWidth = 5; rectangleShape8. BorderWidth = 5; rectangleShape9. BorderWidth = 5; break;}

case 5: {rectangleShape7. BorderWidth = 1; rectangleShape8. BorderWidth = 1; rectangleShape9. BorderWidth = 1; lineShape10. BorderWidth = 5; lineShape9. BorderWidth = 5; lineShape8. BorderWidth = 5; lineShape13. BorderWidth = 5; lineShape12. BorderWidth = 5; lineShape11. BorderWidth = 5; lineShape14. BorderWidth = 5; lineShape16. BorderWidth = 5; lineShape15. BorderWidth = 5; label20. Visible = true; label21. Visible = true; label22. Visible = true; break;}

case 6: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; lineShape13. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape11. BorderWidth = 2; lineShape14. BorderWidth = 2; lineShape16. BorderWidth = 2; lineShape15. BorderWidth = 2; label20. Visible = false; label21. Visible = false; label22. Visible = false; schot = 0; button3. Enabled = true; timer2. Enabled = false; break;}

}

schot++;

}

private void button3_Click (object sender, EventArgs e)

{

timer3. Enabled = true;

lineShape45. BorderColor = Color. Green; lineShape48. BorderColor = Color. Green; lineShape47. BorderColor = Color. Green; lineShape46. BorderColor = Color. Green;

if (label15. Text == «1») {lineShape18. BorderColor = Color. LimeGreen; lineShape10. BorderColor = Color. LimeGreen; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; if (label1. BackColor == Color. LimeGreen) {label1. BackColor = Color. Red; rectangleShape1. BackColor = Color. Red; label4. BackColor = Color. LimeGreen; rectangleShape2. BackColor = Color. LimeGreen;} else {label1. BackColor = Color. LimeGreen; rectangleShape1. BackColor = Color. LimeGreen; label4. BackColor = Color. Red; rectangleShape2. BackColor = Color. Red;}} else {label20. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape10. BorderColor = Color. Red; lineShape9. BorderColor = Color. Red; lineShape8. BorderColor = Color. Red;}

if (label17. Text == «1») {lineShape22. BorderColor = Color. LimeGreen; lineShape11. BorderColor = Color. LimeGreen; lineShape12. BorderColor = Color. LimeGreen; lineShape13. BorderColor = Color. LimeGreen; label21. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; if (label2. BackColor == Color. LimeGreen) {label2. BackColor = Color. Red; rectangleShape3. BackColor = Color. Red; label5. BackColor = Color. LimeGreen; rectangleShape4. BackColor = Color. LimeGreen;} else {label2. BackColor = Color. LimeGreen; rectangleShape3. BackColor = Color. LimeGreen; label5. BackColor = Color. Red; rectangleShape4. BackColor = Color. Red;}} else {label21. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape11. BorderColor = Color. Red; lineShape12. BorderColor = Color. Red; lineShape13. BorderColor = Color. Red;}

if (label19. Text == «1») {lineShape26. BorderColor = Color. LimeGreen; lineShape14. BorderColor = Color. LimeGreen; lineShape16. BorderColor = Color. LimeGreen; lineShape15. BorderColor = Color. LimeGreen; label22. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; if (label3. BackColor == Color. LimeGreen) {label3. BackColor = Color. Red; rectangleShape5. BackColor = Color. Red; label6. BackColor = Color. LimeGreen; rectangleShape6. BackColor = Color. LimeGreen;} else {label3. BackColor = Color. LimeGreen; rectangleShape5. BackColor = Color. LimeGreen; label6. BackColor = Color. Red; rectangleShape6. BackColor = Color. Red;}} else {label22. Text = «Π±Π΅Π· ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ»; lineShape14. BorderColor = Color. Red; lineShape16. BorderColor = Color. Red; lineShape15. BorderColor = Color. Red;}

button3. Enabled = false;

groupBox4. Visible = true;

}

private void timer3_Tick (object sender, EventArgs e)

{

switch (schot)

{

case 1: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; lineShape13. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape11. BorderWidth = 2; lineShape14. BorderWidth = 2; lineShape16. BorderWidth = 2; lineShape15. BorderWidth = 2; label20. Visible = false; label21. Visible = false; label22. Visible = false; lineShape20. BorderWidth = 5; lineShape23. BorderWidth = 5; lineShape27. BorderWidth = 5; break;}

case 2: {lineShape20. BorderWidth = 2; lineShape23. BorderWidth = 2; lineShape27. BorderWidth = 2; rectangleShape11. BorderWidth = 5; rectangleShape13. BorderWidth = 5; rectangleShape15. BorderWidth = 5; break;}

case 3: {rectangleShape11. BorderWidth = 1; rectangleShape13. BorderWidth = 1; rectangleShape15. BorderWidth = 1; lineShape18. BorderWidth = 5; lineShape22. BorderWidth = 5; lineShape26. BorderWidth = 5; break;}

case 4: {lineShape18. BorderWidth = 2; lineShape22. BorderWidth = 2; lineShape26. BorderWidth = 2; rectangleShape7. BorderWidth = 5; rectangleShape8. BorderWidth = 5; rectangleShape9. BorderWidth = 5; break;}

case 5: {rectangleShape7. BorderWidth = 1; rectangleShape8. BorderWidth = 1; rectangleShape9. BorderWidth = 1; lineShape10. BorderWidth = 5; lineShape9. BorderWidth = 5; lineShape8. BorderWidth = 5; lineShape13. BorderWidth = 5; lineShape12. BorderWidth = 5; lineShape11. BorderWidth = 5; lineShape14. BorderWidth = 5; lineShape16. BorderWidth = 5; lineShape15. BorderWidth = 5; label20. Visible = true; label21. Visible = true; label22. Visible = true; break;}

case 6: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; lineShape13. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape11. BorderWidth = 2; lineShape14. BorderWidth = 2; lineShape16. BorderWidth = 2; lineShape15. BorderWidth = 2; label20. Visible = false; label21. Visible = false; label22. Visible = false; break;}

case 7: {timer1. Enabled = false; schot = 0; button5. Enabled = true; timer3. Enabled = false; break;}

}

schot++;

}

private void textBox1_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox2_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox3_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox4_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox5_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

private void textBox6_KeyPress (object sender, KeyPressEventArgs e)

{

if (e. KeyChar == (char) Keys. D0 || e. KeyChar == (char) Keys. D1 || (e. KeyChar == (char) Keys. Back)) {return;} // Π·Π°ΠΏΡ€Π΅Ρ‚ Π²Π²ΠΎΠ΄Π° всСго, ΠΊΡ€ΠΎΠΌΠ΅ 0 ΠΈ 1 Π² Π’Π‘1

else e. Handled = true;

}

int schot2 = 0;

private void timer4_Tick (object sender, EventArgs e) //

{

schot2++;

switch (schot2)

{

case 1: {lineShape6. BorderWidth = 5; break;}

case 2: {lineShape6. BorderWidth = 2; lineShape49. BorderWidth = 5; break;}

case 3: {lineShape49. BorderWidth = 2; rectangleShape18. BorderWidth = 5; break;}

case 4: {rectangleShape18. BorderWidth = 1; lineShape38. BorderWidth = 5; break;}

case 5: {lineShape38. BorderWidth = 2; lineShape39. BorderWidth = 5; break;}

case 6: {lineShape39. BorderWidth = 2; lineShape40. BorderWidth = 5; break;}

case 7: {lineShape40. BorderWidth = 2; rectangleShape8. BorderWidth = 5; break;}

case 8: {rectangleShape8. BorderWidth = 1; lineShape11. BorderWidth = 5; lineShape12. BorderWidth = 5; label21. Visible = true; lineShape13. BorderWidth = 5; break;}

case 9: {lineShape11. BorderWidth = 2; lineShape12. BorderWidth = 2; lineShape13. BorderWidth = 2; label21. Visible = false; schot2 = 0; timer4. Enabled = false; break;}

}

}

private void button5_Click (object sender, EventArgs e)

{

button5. Enabled = false;

if (label18. Text == «1» && label19. Text == «1») {timer4. Enabled = true; lineShape6. BorderColor = Color. LimeGreen; lineShape49. BorderColor = Color. LimeGreen; lineShape38. BorderColor = Color. LimeGreen; lineShape39. BorderColor = Color. LimeGreen; lineShape40. BorderColor = Color. LimeGreen; label21. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; lineShape13. BorderColor = Color. LimeGreen; lineShape12. BorderColor = Color. LimeGreen; lineShape11. BorderColor = Color. LimeGreen; if (label2. BackColor == Color. LimeGreen) {label2. BackColor = Color. Red; label5. BackColor = Color. LimeGreen; rectangleShape3. BackColor = Color. Red; rectangleShape4. BackColor = Color. LimeGreen;} else {label2. BackColor = Color. LimeGreen; label5. BackColor = Color. Red; rectangleShape3. BackColor = Color. LimeGreen; rectangleShape4. BackColor = Color. Red;}}

if (label16. Text == «1» && label17. Text == «1») {timer5. Enabled = true; lineShape37. BorderColor = Color. LimeGreen; lineShape36. BorderColor = Color. LimeGreen; lineShape35. BorderColor = Color. LimeGreen; lineShape4. BorderColor = Color. LimeGreen; lineShape2. BorderColor = Color. LimeGreen; label20. Text = «ΡΠΌΠ΅Π½Π° Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π°»; lineShape9. BorderColor = Color. LimeGreen; lineShape8. BorderColor = Color. LimeGreen; lineShape10. BorderColor = Color. LimeGreen; if (label1. BackColor == Color. LimeGreen) {label1. BackColor = Color. Red; label4. BackColor = Color. LimeGreen; rectangleShape1. BackColor = Color. Red; rectangleShape2. BackColor = Color. LimeGreen;} else {label1. BackColor = Color. LimeGreen; label4. BackColor = Color. Red; rectangleShape1. BackColor = Color. LimeGreen; rectangleShape2. BackColor = Color. Red;}}

}

int schot3 = 0;

private void timer5_Tick (object sender, EventArgs e)

{

schot3++;

switch (schot3)

{

case 1: {lineShape2. BorderWidth = 5; break;}

case 2: {lineShape2. BorderWidth = 2; lineShape4. BorderWidth = 5; break;}

case 3: {lineShape4. BorderWidth = 2; rectangleShape16. BorderWidth = 5; break;}

case 4: {rectangleShape16. BorderWidth = 1; lineShape35. BorderWidth = 5; break;}

case 5: {lineShape35. BorderWidth = 2; lineShape36. BorderWidth = 5; break;}

case 6: {lineShape36. BorderWidth = 2; lineShape37. BorderWidth = 5; break;}

case 7: {lineShape37. BorderWidth = 2; rectangleShape7. BorderWidth = 5; break;}

case 8: {rectangleShape7. BorderWidth = 1; lineShape10. BorderWidth = 5; lineShape9. BorderWidth = 5; label20. Visible = true; lineShape8. BorderWidth = 5; break;}

case 9: {lineShape10. BorderWidth = 2; lineShape9. BorderWidth = 2; lineShape8. BorderWidth = 2; label20. Visible = false; schot3 = 0; timer5. Enabled = false; break;}

}

}

private void Form4_FormClosed (object sender, FormClosedEventArgs e)

{

groupBox1. Visible = false;

textBox2. Text = ««;

textBox3. Text = ««;

textBox6. Text = ««;

textBox5. Text = ««;

timer1. Enabled = false;

timer2. Enabled = false;

timer3. Enabled = false;

timer4. Enabled = false;

timer5. Enabled = false;

schot = 0;

schot2 = 0;

schot3 = 0;

label14. Text = textBox1. Text;

label15. Text = textBox4. Text;

label16. Text = textBox2. Text;

label17. Text = textBox5. Text;

label18. Text = textBox3. Text;

label19. Text = textBox6. Text;

lineShape10. BorderColor = Color. Red;

lineShape9. BorderColor = Color. Red;

lineShape8. BorderColor = Color. Red;

lineShape11. BorderColor = Color. Red;

lineShape12. BorderColor = Color. Red;

lineShape13. BorderColor = Color. Red;

lineShape14. BorderColor = Color. Red;

lineShape15. BorderColor = Color. Red;

lineShape16. BorderColor = Color. Red;

lineShape17. BorderColor = Color. Red;

lineShape18. BorderColor = Color. Red;

lineShape21. BorderColor = Color. Red;

lineShape22. BorderColor = Color. Red;

lineShape25. BorderColor = Color. Red;

lineShape26. BorderColor = Color. Red;

lineShape6. BorderColor = Color. Black;

lineShape49. BorderColor = Color. Black;

lineShape38. BorderColor = Color. Black;

lineShape39. BorderColor = Color. Black;

lineShape40. BorderColor = Color. Black;

lineShape2. BorderColor = Color. Black;

lineShape4. BorderColor = Color. Black;

lineShape35. BorderColor = Color. Black;

lineShape36. BorderColor = Color. Black;

lineShape37. BorderColor = Color. Black;

lineShape2. BorderWidth = 2;

lineShape10. BorderWidth = 2;

lineShape4. BorderWidth = 2;

lineShape6. BorderWidth = 2;

lineShape7. BorderWidth = 2;

lineShape8. BorderWidth = 2;

lineShape9. BorderWidth = 2;

lineShape11. BorderWidth = 2;

lineShape12. BorderWidth = 2;

lineShape13. BorderWidth = 2;

lineShape14. BorderWidth = 2;

lineShape15. BorderWidth = 2;

lineShape16. BorderWidth = 2;

lineShape17. BorderWidth = 2;

lineShape18. BorderWidth = 2;

lineShape19. BorderWidth = 2;

lineShape20. BorderWidth = 2;

lineShape21. BorderWidth = 2;

lineShape22. BorderWidth = 2;

lineShape23. BorderWidth = 2;

lineShape24. BorderWidth = 2;

lineShape25. BorderWidth = 2;

lineShape26. BorderWidth = 2;

lineShape27. BorderWidth = 2;

lineShape28. BorderWidth = 2;

lineShape29. BorderWidth = 2;

lineShape30. BorderWidth = 2;

lineShape31. BorderWidth = 2;

lineShape32. BorderWidth = 2;

lineShape33. BorderWidth = 2;

lineShape34. BorderWidth = 2;

lineShape35. BorderWidth = 2;

lineShape36. BorderWidth = 2;

lineShape37. BorderWidth = 2;

lineShape38. BorderWidth = 2;

lineShape39. BorderWidth = 2;

lineShape40. BorderWidth = 2;

lineShape41. BorderWidth = 2;

lineShape42. BorderWidth = 2;

lineShape43. BorderWidth = 2;

lineShape44. BorderWidth = 2;

lineShape45. BorderWidth = 2;

lineShape46. BorderWidth = 2;

lineShape47. BorderWidth = 2;

lineShape48. BorderWidth = 2;

lineShape49. BorderWidth = 2;

lineShape50. BorderWidth = 2;

lineShape51. BorderWidth = 2;

lineShape52. BorderWidth = 2;

lineShape53. BorderWidth = 2;

button3. Enabled = false;

button5. Enabled = false;

groupBox4. Visible = false;

label20. Text = «Π‘Π•Π— Π˜Π—ΠœΠ•ΠΠ•ΠΠ˜Π™»;

label21. Text = «Π‘Π•Π— Π˜Π—ΠœΠ•ΠΠ•ΠΠ˜Π™»;

label22. Text = «Π‘Π•Π— Π˜Π—ΠœΠ•ΠΠ•ΠΠ˜Π™»;

if (label14. Text == «1») lineShape19. BorderColor = Color. LimeGreen; else lineShape19. BorderColor = Color. Red;

if (label15. Text == «1») lineShape20. BorderColor = Color. LimeGreen; else lineShape20. BorderColor = Color. Red;

if (label16. Text == «1») lineShape24. BorderColor = Color. LimeGreen; else lineShape24. BorderColor = Color. Red;

if (label17. Text == «1») lineShape23. BorderColor = Color. LimeGreen; else lineShape23. BorderColor = Color. Red;

if (label18. Text == «1») lineShape28. BorderColor = Color. LimeGreen; else lineShape28. BorderColor = Color. Red;

if (label19. Text == «1») lineShape27. BorderColor = Color. LimeGreen; else lineShape27. BorderColor = Color. Red;

lineShape41. BorderColor = Color. IndianRed; lineShape42. BorderColor = Color. IndianRed; lineShape43. BorderColor = Color. IndianRed; lineShape44. BorderColor = Color. IndianRed;

lineShape45. BorderColor = Color. IndianRed; lineShape48. BorderColor = Color. IndianRed; lineShape47. BorderColor = Color. IndianRed; lineShape46. BorderColor = Color. IndianRed;

button1. Enabled = true;

button2. Enabled = true;

groupBox2. Visible = false;

groupBox3. Visible = false;

label27. Visible = false;

}

}

}

ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ вСсь тСкст
Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Ρ„ΠΎΡ€ΠΌΡƒ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Ρ€Π°Π±ΠΎΡ‚ΠΎΠΉ