🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
2 messages
2 total messages Started by Christian Fri, 01 Nov 2002 01:15
VB.Net en tabellen
#6908
Author: Christian
Date: Fri, 01 Nov 2002 01:15
85 lines
2312 bytes
Hallo,



Deze oefening is geschreven in de ConsoleApplication van VB.Net.

Als resultaat van de uitvoering hiervan verkrijgt men op het scherm, onder
elkaar drie tabellen waarin deze getallen staan geschreven :



1 2 3 4 5 6 7 8 9 10

10 9 8 7 6 5 4 3 2 1

10 9 8 7 6 6 7 8 9 10



Het probleem is echter dat bij de laatste tabel de getallen niet mogen
geschreven worden zoals ik het gedaan heb, maar dat de waarden vanuit de
tabel tblTABELA(intXA) en tblTABELB(intXB)moeten worden afgeleidt. Dit lukt
echter niet, heeft iemand soms wat advies aub?

Alvast bedankt,



Christian.





 Sub main()



        Dim intXA As Integer = 9

        Dim intXB As Integer = 9

        Dim tblTABELA(intXA) As Integer

        Dim tblTABELB(intXB) As Integer



        For intXA = 0 To 9

            tblTABELA(intXA) = intXA + 1

            Console.Write(tblTABELA(intXA) & " ")

        Next



        Console.WriteLine()



        For intXB = 9 To 0 Step -1

            tblTABELB(intXB) = intXB + 1

            Console.Write(tblTABELB(intXB) & " ")

        Next



        Console.WriteLine()



        Console.Write("10 9 8 7 6 6 7 8 9 10")



        Console.ReadLine()



   End Sub
Re: VB.Net en tabellen
#6915
Author: Ludo Joris
Date: Sat, 02 Nov 2002 14:12
47 lines
2304 bytes
On Fri, 01 Nov 2002 01:15:03 GMT, "Christian"
<Christian.Rosseel@pandora.be> wrote:

>Deze oefening is geschreven in de ConsoleApplication van VB.Net.
>
>Als resultaat van de uitvoering hiervan verkrijgt men op het scherm, onder
>elkaar drie tabellen waarin deze getallen staan geschreven :
>
>1 2 3 4 5 6 7 8 9 10
>
>10 9 8 7 6 5 4 3 2 1
>
>10 9 8 7 6 6 7 8 9 10
>
>Het probleem is echter dat bij de laatste tabel de getallen niet mogen
>geschreven worden zoals ik het gedaan heb, maar dat de waarden vanuit de
>tabel tblTABELA(intXA) en tblTABELB(intXB)moeten worden afgeleidt. Dit lukt
>echter niet, heeft iemand soms wat advies aub?


imports system

class Mainclass
	
  public shared sub Main
	
    dim a(9) as integer, b(9) as integer, c(9) as integer
    dim i as integer
 
    a = new integer(){1,2,3,4,5,6,7,8,9,10}
    b = new integer(){10,9,8,7,6,5,4,3,2,1}
    
    for i=0 to 9:console.write(" " & a(i)):next:console.writeline()
    for i=0 to 9:console.write(" " & b(i)):next:console.writeline()
    for i=0 to 9:console.write(" " & c(i)):next:console.writeline()

    for i=0 to 9
       if a(i)>=b(i) then c(i)=a(i) else c(i)=b(i)
    next
    
    for i=0 to 9:console.write(" " & c(i)):next:console.writeline()

  end sub
	
end class

HTH
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads