【发布时间】:2012-03-31 14:19:41
【问题描述】:
我的任务是创建一个 Visual Basic 控制台脚本,它要求用户连续 5 次将一个数字输入一个数组(销售数字以千为单位),然后将这些结果显示为一种计数图表。
例如数据:sales(10,7,12,5,15) 输出将是
2008:++++++++++
2009:+++++++
2010:++++++++++++
2011:+++++
2012:+++++++++++++++
到目前为止我拥有的代码:
Module Module1
Sub Main()
Dim sales(4) As Integer
Dim index As Integer
Dim year As Integer
For index = 0 To 4
Console.Write("Enter your sales numbers (in thousands): ")
sales(index) = Console.ReadLine()
Next
year = 2007
For index = 0 To 4
year = (year + 1)
---不确定这里的代码---
Console.WriteLine(year & ": " & ????????)
Next
Console.ReadLine()
End Sub
End Module
我只是不确定如何将数组中的整数值更改为一定数量的单个字符。
【问题讨论】:
标签: vb.net arrays visual-studio integer