I'm creating a diving competion program that
1. keeps score for up to 16 divers.
2. Each diver has 8 dives.
3. There are 8 judges scoring each dives w/scores ranging from 0-10 w/one decimal place.
4. Each dive has a degree of difficulty from 1-4 w/two decimal places.
5. To get their final scores, throw-out the highest & the lowest and then add the remaining 6 and multiply by the degree of difficulty.
The problem I'm running into is that the text file with the names of the divers isn't showing up when I run the program so that I can pick a name from the list. - Public Class Form1
-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
Dim dt As New DataTable
-
dt.Columns.Add(New DataColumn With
-
{.ColumnName = "Identifier", .DataType = GetType(Int32), .AutoIncrement = True})
-
dt.Columns.Add(New DataColumn With
-
{.ColumnName = "Description", .DataType = GetType(String)})
-
dt.Columns.Add(New DataColumn With
-
{.ColumnName = "Factor", .DataType = GetType(Decimal)})
-
dt.Rows.Add(New Object() {Nothing, "Bellyflop", 4D})
-
dt.Rows.Add(New Object() {Nothing, "Canonball", 2D})
-
dt.Rows.Add(New Object() {Nothing, "Back Flying Somersault", 3D})
-
dt.Rows.Add(New Object() {Nothing, "Back Flying 2 1/2 Somersault", 3.56D})
-
dt.Rows.Add(New Object() {Nothing, "Reverse Dive", 3.52D})
-
dt.Rows.Add(New Object() {Nothing, "Inward Somersault", 3.36D})
-
dt.Rows.Add(New Object() {Nothing, "Inward 1 1/2 Somersault", 3.54D})
-
dt.Rows.Add(New Object() {Nothing, "Forward Dive 1/2 Twist", 3.51D})
-
ListBox1.DisplayMember = "Description"
-
ListBox1.ValueMember = "Factor"
-
ListBox1.DataSource = dt
-
Label1.DataBindings.Add("Text", dt, "Factor")
-
ListBox1.Items.LoadFromFile("Names.txt")
-
End Sub
-
-
Private Sub ListBox1_SelectedIndexChanged(
-
ByVal sender As System.Object,
-
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
-
Console.WriteLine("Factor {0}", CDec(ListBox1.SelectedValue))
-
End Sub
-
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
Dim ScoreSum =
-
(
-
From T In Me.Controls.OfType(Of NumericUpDown)()
-
Select T.Value).Sum / CDec(ListBox1.SelectedValue)
-
TextBox1.Text = ScoreSum.ToString("n2")
-
End Sub
-
End Class
-
-
Module Module1
-
-
<System.Runtime.CompilerServices.Extension()> _
-
Public Sub LoadFromFile(
-
ByVal sender As ListBox.ObjectCollection,
-
ByVal FileName As String)
-
sender.AddRange(IO.File.ReadAllLines(FileName))
-
End Sub
-
-
End Module
0 1200 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Frank Maestas |
last post by:
Hello,
I have a company MySQL database containing e-mail addresses. Some of
these addresses are bad. I have a text file with the addresses I need
to remove from the MySQL database.
Is there a...
|
by: Jesper |
last post by:
How can I open a textfile from C# using notepad (or the
user assigned application for this).
|
by: Cleako |
last post by:
I am writing a program that formats the data and prints it to a text file. I
know that a text file wont hold the form feed and recognize it but what is an
ideal way to get a new page? Would it...
|
by: Murali |
last post by:
Hello Everyone,
I am breaking my head with this problem. Please help
me out. Let me first explain my problem :
Here it is:
I am working in realtime environment where i will be creating...
|
by: Brad |
last post by:
I have a file that downloaded a CSV file for the user based upon some
information gathered from the Database. My file was working fine until
recently (I believe that my hosting company did...
|
by: DH |
last post by:
Hi,
I'm trying to strip the html and other useless junk from a html page..
Id like to create something like an automated text editor, where it
takes the keywords from a txt file and removes them...
|
by: vincec |
last post by:
Hi need some help from you guysin using visual C++. I am thinking of opening a text file after some calculation. For example, after i press the "calculation", then at the OnCalculation function, it...
|
by: manontheedge |
last post by:
I'm having a problem when I work with Access using VB6. I don't have a problem controlling Access, but I want the Access file to stay open when the program ends...but it always closes itself, and I...
|
by: Joe Strout |
last post by:
On Nov 19, 2008, at 3:27 PM, Mohsen Akbari wrote:
Appears that way where? Using what tool to view it?
My guess is that there is nothing wrong with the file, but that
whatever you're using...
|
by: Matthew Barnett |
last post by:
Steve Holden wrote:
20
Some text editors can display very long lines, others can't and just
wrap them when displaying. Notepad can't.
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |