Προγραμματισμός & Εφαρμογές Υπολογιστών (βρόχος Do...loop_)

  • View
    106

  • Download
    4

Embed Size (px)

Transcript

  • 1. Do Loop Do Loop .

2. 3. Do Loop DoLoop . 4. Visual Basic : (For Next) (Do While Do Loop While) (Do Until Do Loop Until) 5. ForNext, DoLoop, . DoLoop . Do Loop 6. . Do Loop (). Do Loop 7. 1: Do While () Loop Do Loop 8. 8 . . For Next Do While Loop -a1 -am Do While Loop = 1 2 -a1 -a2 -am For Next 9. . "". 1 : Do Loop 10. Dim Name As String Name = "" Do While Name "" Name = InputBox(" ") Print Name Loop 1.1: Do Loop 11. Dim Name As String Name = "" Do While Name "" Name = InputBox(" ") If Name "" Then Print Name End If Loop 1.2 : Do Loop 12. Dim Name As String Name = InputBox(" ") Do While Name " Print Name Name = InputBox(" ") Loop 1.3: Do Loop 13. 2: Do () Loop While Do Loop 14. Dim Name As String Do Name = InputBox(" ") If Name "" Then Print Name End If Loop While Name "" 2 : Do Loop 15. : = ( + 40)*5 /9 40 3: Do Loop 16. ( ) InputBox, . . 3: Do Loop 17. Dim FTemp As Single, Celsius As Single Do FTemp=InputBox(" ") If FTemp "" Then Celsius = Int((FTemp + 40)*5 /9 - 40) MsgBox(Celsius), ," " End If Loop While FTemp "" 3: Do Loop 18. Do Number=InputBox(" -1 ") Number=Number* Number Print Number Loop While Number>=0 4: 19. 1 . , end. . 20. 1 sum =0 counter = 0 Do Name = InputBox(" end ") posotita = InputBox(" ") sum = sum + posotita counter = counter + 1 Loop While Name "end" Print " : "; sum / counter 21. 1 sum =0 counter = 0 Do Name = InputBox(" end ") If Name "end" Then posotita = InputBox("dose posotita") sum = sum + posotita counter = counter + 1 End If Loop While Name "end" Print " : "; sum / counter 22. Do Loop Until (Until) . Until While . Do Loop 23. 3: Do Until () Loop Do Loop 24. Dim Name As String Name = "" Do Until Name="" Name = InputBox(" ") If Name "" Then Print Name End If Loop Do Loop 25. 4: Do () Loop Until Do Loop 26. Dim Name As String Do Name = InputBox(" ") If Name "" Then Print Name End If Loop Until Name="" Do Loop 27. Do Loop : . : -a1 -am 2. Do Loop While -a1 -am 1. Do While Loop -a1 -am 3. Do Until Loop -a1 -am 4. Do Loop Until 28. . 2 . : 1. 2. . 3. . 2 3 , . . 2 29. 2 Dim Name As String Dim Posotita As Single Dim Poson As Single Dim Sum As Single Dim Counter As Integer Sum = 0 Counter = 0 30. 2 Do Name = InputBox("") If Name "Telos" Then posotita = InputBox(" ") counter=counter +1 poson = 2 * posotita sum = sum + poson Print Name, " ="; poson End If Loop While Name "Telos" 31. 2 Print " "; sum Print " "; sum/counter