1 / 13

Linijski programi

Linijski programi. Zadatak 1. Napisati Visual Basic projekat za sabiranje dva broja. a , b. c = a+b. c. Deklaracija promenljivih. Dim a As Single Dim b As Single Dim c As Single. Ulazni korak. a = txta.Text b = txtb.Text

dorie
Download Presentation

Linijski programi

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linijski programi

  2. Zadatak 1. • Napisati Visual Basic projekatza sabiranje dva broja. a, b c = a+b c

  3. Deklaracija promenljivih • Dim a As Single • Dim b As Single • Dim c As Single

  4. Ulazni korak • a = txta.Text • b = txtb.Text • U ulaznom koraku se vrednosti ulaznih promenljivih a i b učitavaju iz textbox-ova txta i txtb. (u ovim tekstboksovima su podaci koje unosi korisnik)

  5. Obrada • c = a + b • Jedan ili više izraza kojima se izračunavaju izlazni podaci na osnovu poznatih ulaznih podataka.

  6. Izlazni korak • txtc.Text = c • U izlaznom koraku se vrednost izlazne promenljivecupisuje u textbox txtc.

  7. Dim a As Single Dim b As Single Dim c As Single a = txta.Text b = txtb.Text c = a + b txtc.Text = c a, b c = a+b c

  8. Zadatak2. • Napisati VB projekat za određivanje površine kocke. a P = 6a2 P a

  9. Dim a As Single Dim P As Single a = txta.Text P = 6 * a ^ 2 txtP.Text = P a P = 6a2 P

  10. Zadatak 3. • Projektovati program za određivanje površine i zapremine valjka. r H

  11. Dim r As Single Dim H As Single Dim P As Single Dim V As Single r = txtr.Text H = txtH.Text P = 2*3.14*r^2+2*3.14*r*H V = r^2*3.14*H txtP.Text = P txtV.Text = V r,H P,V

  12. Zadatak 4. • Projektovati program za određivanje obima i površine trougla. Korisnik unosi dužine stranica a, b, c. O = a + b + c

  13. Dim a As Single Dim b As Single Dim c As Single Dim s As Single Dim O As Single Dim P As Single a = txta.Text b = txtb.Text c = txtc.Text s = (a+b+c)/2 P = SQR(s*(s-a)*(s-b)*(s-c)) O = a + b + c txtO.Text = O txtP.Text = P a,b,c O, P

More Related