Hi,
I have a predefined code(which may not be changed), and by user entered values remembered and display this data like in output below.
Does anyone have any idea to write additional methods or functions for getting this output?
Predefined code:
Output should be(also with Count and Capacity):
I have a predefined code(which may not be changed), and by user entered values remembered and display this data like in output below.
Does anyone have any idea to write additional methods or functions for getting this output?
Predefined code:
VB.NET:
Module ArraysDataRemember
Sub Main()
Dim count As Integer = 0
Dim values(1) As Integer
Do
PrintValues(values, count)
'
Console.Write("Value ? : ")
Dim newValue As Integer = Console.ReadLine()
count += 1
'
If count > values.Length Then
values = GetArrayWithDoubledCapacity(values)
End If
'
StoreValue(values, newValue, count - 1)
Loop
'
Console.ReadLine()
End Sub
'...
End Module
Output should be(also with Count and Capacity):
VB.NET:
Values (count=0/capacity=2) :
Value ? : 10
Values (count=1/capacity=2) : 10
Value ? : 20
Values (count=2/capacity=2) : 10 20
Value ? : 30
Values (count=3/capacity=4) : 10 20 30
Value ? : 40
Values (count=4/capacity=4) : 10 20 30 40
Value ? : 50
Values (count=5/capacity=8) : 10 20 30 40 50
Value ? : 60
Values (count=6/capacity=8) : 10 20 30 40 50 60
Value ? : 70
Values (count=7/capacity=8) : 10 20 30 40 50 60 70
Value ? : 80
Values (count=8/capacity=8) : 10 20 30 40 50 60 70 80
Value ? : 90
Values (count=9/capacity=16) : 10 20 30 40 50 60 70 80 90
Value ? :