41824

Программирование алгоритмов формирования и обработки двумерных массивов

Лабораторная работа

Информатика, кибернетика и программирование

Выполнения данной лабораторной работы состоит в изучении средств, приемов и получении практических навыков разработки, написания и отладки программ формирования и обработки двумерных массивов...

Русский

2017-07-28

79.24 KB

3 чел.

МОСКОВСКИЙ ТЕХНИЧЕСКИЙ УНИВЕРСИТЕТ СВЯЗИ И ИНФОРМАТИКИ


Кафедра «Информатики»

Лабораторные работы по дисциплине «Информатика»

Выполнила студентка группы БИН1209
Зименкова Наталья Андреевна

Вариант 7

Москва 2013

Лабораторная работа №4.8.


«Тема 4.8. Программирование алгоритмов формирования и обработки двумерных  массивов»

Вариант 7

Зименкова Наталья Андреевна
БИН 1209

Москва 2013 г.

Цель выполнения данной лабораторной работы состоит в  изучении  средств, приемов и получении практических навыков разработки, написания и отладки программ формирования и обработки двумерных массивов.

Задание на разработку проекта.

Графический интерфейс пользователя

Схемы алгоритмов процедур пользователя

                                       

                      

Программный код с использованием процедур

Public Class Form1

   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

       Dim m, n As Integer

       Dim L(,) As Single

       m = vvod(TextBox1)

       n = vvod(TextBox2)

       Dim K(m, n) As Single

       postroenie_K(m, n, K)

       vivodMass(m, n, K, ListBox1)

       L = create_L(m, n, K)

       vivodMass(m, n, L, ListBox2)

   End Sub

   Function vvod(ByVal T As TextBox) As Integer

       Return Val(T.Text)

   End Function

   Sub vivodMass(ByVal m As Integer, ByVal n As Integer, ByVal a(,) As Single, ByRef ListBox As ListBox)

       Dim i, j As Integer

       Dim a1, a2 As String

       a1 = " "

       a2 = " "

       ListBox.Items.Add(a1)

       For i = 0 To m - 1

           a1 = " "

           For j = 0 To n - 1

               If a(i, j) < 0 Then a2 = Space(3) Else a2 = Space(4)

               a1 = a1 + Format(a(i, j), "00") + a2

           Next

           ListBox.Items.Add(a1)

       Next

       a1 = " "

   End Sub

   Sub postroenie_K(ByVal m As Integer, ByVal n As Integer, ByRef a(,) As Single)

       Dim i, j As Integer

       Randomize()

       For i = 0 To m - 1

           For j = 0 To n - 1

               a(i, j) = -10 + 20 * Rnd()

           Next

       Next

   End Sub

   Function create_L(ByVal m As Integer, ByVal n As Integer, ByVal a(,) As Single) As Single(,)

       Dim L(m, n) As Single

       Dim i, j As Integer

       For i = 0 To m - 1

           For j = 0 To n - 1

               L(i, j) = a(m - i - 1, j)

           Next

       Next

       Return L

   End Function

   Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

       Application.Exit()

   End Sub

End Class


 

А также другие работы, которые могут Вас заинтересовать

11227. Talk about madame tussaud’s as one of london’s famous museums 24.5 KB
  Talk about madame tussauds as one of londons famous museums. It often comes as a shock for Londoners that Madame Tussauds museum is one of the capital top tourist attractions. Many find it gruesome and frightening. Others maintain that its collection of wax statues has no artistic merit. Yes despite this criticism Madam Tussauds has become a world famous. Millions of tourists from overseas and from other parts of Britain wouldnt consider their trip to the capital worthwhile with...
11228. TAIK ABOUT HOLYWOOD AND THE EPICS PRODUCED THERE IN THE 1930S AND 1940S 23.5 KB
  TAIK ABOUT HOLYWOOD AND THE EPICS PRODUCED THERE IN THE 1930S AND 1940S. Nowadays for million if people theres nothing better than watching a good film and the vast majority of films are produced in Hollywood. But what we really know about this really know about this greatstar factory To tell the truth everything we read about the great days of Hollywood in the 30s and 40s seems like exaggeration. The studious always said their film were superb and colossal because vast s...
11229. TALK ABOUT THE LANGUAGE OF SHAKESPEAR AND THE DIFFICULTIES OF PRESENTING SHAKESPEAR’S CHARACTERS TO A MODERN AUDIENCE 23.5 KB
  TALK ABOUT THE LANGUAGE OF SHAKESPEAR AND THE DIFFICULTIES OF PRESENTING SHAKESPEARS CHARACTERS TO A MODERN AUDIENCE. For any Englishman there are never can be any discussion on topic who is the worlds greatest poet and dramatist. Only one name possibly suggest itself to him: that of W Shakespeare. All of us use words phrases and quotation from Shs writings that have become part of the common property of Englishspeaking people. Shakespeare more perhaps than any other writer ...
11230. DESCRIBE AN ENGLISH JOURNALIST’S IMPRESSIONS OF TRAVELLING THROUGH THEVAST SPASES OF RUSSIA, CHINA AND MONGOLIA 23.5 KB
  DESCRIBE AN ENGLISH JOURNALISTS IMPRESSIONS OF TRAVELLING THROUGH THEVAST SPASES OF RUSSIA CHINA AND MONGOLIA. Its no wonder that trains are a literary genre all on their own. Writers from Graham Green to Agatha Christie realized that there is nothing quite like curtain sleeping compartments quicken the narrative pulse. To board the train that crosses countries and continents is to feel that anything might happened. From the first days of a journey on board a TransSiberian Expr...
11231. THE ETHICAL AND CULTURAL HERITAGE OF THE BIBLE: CHRISTIAN VIRTUES SA DESCRIBED IN THE BIBLE AND THEIR ETERNAL VALUE 24 KB
  THE ETHICAL AND CULTURAL HERITAGE OF THE BIBLE: CHRISTIAN VIRTUES SA DESCRIBED IN THE BIBLE AND THEIR ETERNAL VALUE. To become a real Christian you must obtain certain qualities of mind and heart which are called Christian virtues. The main virtues are: love hope faith humility patience meekness selfcontrol. Love is surely the most important of all Christian qualities. Firstly a man must love God with all his heart soul mind and strength. Secondly a man should love his neig...
11232. THE ETHICAL AND CULTURAL HERITAGE OF THE BIBLE: SINS AND STRUGGLE WITH THEM AS DESCRIBED IN THE BIBLE 24 KB
  THE ETHICAL AND CULTURAL HERITAGE OF THE BIBLE: SINS AND STRUGGLE WITH THEM AS DESCRIBED IN THE BIBLE. To start with I should say that there are some sins called deadly sins because they are especially ruinous for ones soul. They are pride covetousness lust envy gluttony anger sloth other sins are idle talk filthy language slander bribery sponging murder magic and witchcraft adultery fornication violation incest and cruelty. All of them are originated from the 7 ...
11233. TALK ABOUT THE MAIN IDEAS AND CHARACTERS OF THE BOOK YOU’VE READ AND DISCUSSED IN CLASS 24.5 KB
  TALK ABOUT THE MAIN IDEAS AND CHARACTERS OF THE BOOK YOUVE READ AND DISCUSSED IN CLASS. Oscar Wilde was an Irish playwright poet and author of numerous stories and one novel. Known for his biting wit he became one of the most successful playwrights of the late Victorian era in London and one of the greatest celebrities of his day. Wilde suffered a dramatic downfall and was imprisoned for two years; after Wilde was released from prison he set sail for Dieppe by the night ferry. He nev...
11234. TALK ABOUT UNFORTUNATE EXPERIENCEOF A HOLIDAY ARRANGED THOUGH A TRAVEL AGENCY 24.5 KB
  TALK ABOUT UNFORTUNATE EXPERIENCEOF A HOLIDAY ARRANGED THOUGH A TRAVEL AGENCY. First of all Id like to say that traveling is necessary for all of us as its a kind of relaxation and a good opportunity to relax your body renew your energy and refresh your spirits. Many people adore visiting beautiful places and look forward to going on holiday just to escape daily grind of work and daytoday pressures and get away from their usual sources of stress. Sometimes you need a change and...
11235. GIVE A COMPARATIVE DESCRIPTION OF SOME ANCIENT ENGLISH TOWNS 26 KB
  GIVE A COMPARATIVE DESCRIPTION OF SOME ANCIENT ENGLISH TOWNS. To start with I should say that Britain is a fabulous country a country of startling beauty and diversity its really worth exploring visiting and living in. Its packed with exiting places to go and interesting place to discover. Everyone who comes to England is fascinated by its magnificent picturesque breathtaking and inviting towns where past and present exist side by side. Some of the ancient towns in England are Sa...