HELP!!!!

I'm not sure How to get started nor the steps to design this project.

The file MEMBERS.TXT contains the names of the 100 members of a club. Write a program to randomly select people to serve as President, Treasurer, and Secretary. Note: A person cannot hold more than one office.

Read the list of names into an array of strings.

Randomly choose a number between 1 and 100. If the array-element="EMPTY", choose again. Otherwise the post (president, treasurer or secretary)and the associated name, THEN reset the name to "EMPTY".
Post your code and data if you need more help.
If the n

This is my code :

Public Class frmOffice

Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim randomNum As New Random
Dim name1, name2, name3 As String
Dim sr As IO.StreamReader = IO.File.OpenText("MEMBERS.TXT")
name1 = CStr(sr.ReadLine)
name1 = CStr(txtMembers.Text)
name2 = CStr(sr.ReadLine)
name2 = CStr(txtMembers.Text)
name3 = CStr(sr.ReadLine)
name3 = CStr(txtMembers.Text)
txtMembers.Text = (" " &_ name1 & " " & name2_
& " " & name3)
End Sub
End Class

I've revised my code and am including it now. I've tried to debug it, but am stuck on trying to get it to run properly.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOffice.Click
'Randomlly select office members
Dim randomNum As New Random
Dim sr As IO.StreamReader = IO.File.OpenText("MEMBERS.TXT")
If randomNum.Next(0, 100) = 0 Then
txtMembers.Text = "President"
txtName.Text = CStr(CInt(txtName.Text + 1))
ElseIf randomNum.Next(1, 100) = 0 Then
txtMembers.Text = "Treasurer"
txtName.Text = CStr(CInt(txtName.Text + 1))
ElseIf randomNum.Next(2, 100) = 0 Then
txtMembers.Text = "Secretary"
txtName.Text = CStr(CInt(txtName.Text + 1))
End If
txtName.Text = President & " " & Treasurer & " " & Secretary " "
End Sub
End Class

Also I'm a little confused with your suggestion. Could you restate it a little differentlly for me? Thanks.

1. the source file does not compile because in the print statement, the titles President, ... have not been enclosed in double quotes to make a string. The compiler thinks that it is a variable name, and cannot resolve it.

There is also an extra double quote at the end.

2. The major problem is you have declared the IO.reader, but have not done anything to read the file. So the array would be still empty.

3. The third one is a little detail that has to be included, namely, once you have "elected" a member, you have to eliminate him/her from other posts. This can be done by printing the title and the name, and THEN changing the name to "EMPTY" or other sentinel of your choice. When you pick a name, you have to pick again if the name happens to be "EMPTY".

Give it a try and post your new code.

You're along the right track.

create a project that stores personal information for a electronic black book the fields in the file should include name phone number pager number cell number voice mail

To design and solve this programming problem, you can follow these steps:

1. Read the content of the "MEMBERS.TXT" file and store the names in an appropriate data structure, such as an array or a list.

2. Randomly select a member from the list to serve as the President. You can use a random number generator to generate an index within the range of the list length.

3. Remove the selected member from the list to ensure they cannot be selected for another office. This step is important to make sure a person cannot hold more than one office.

4. Repeat steps 2 and 3 to select members for the remaining offices (Treasurer and Secretary), ensuring that the selected members are different from each other. You can use a for loop and conditional statements to achieve this.

5. Print the names of the members selected for each office.

Here is some pseudocode that demonstrates the steps described above:

```
import random

# Step 1: Read the file and store names
with open("MEMBERS.TXT", "r") as file:
names = file.read().splitlines()

# Step 2: Randomly select President
president_index = random.randint(0, len(names) - 1)
president = names[president_index]

# Step 3: Remove President from list
names.pop(president_index)

# Step 4: Randomly select Treasurer and Secretary
treasurer = random.choice(names)
names.remove(treasurer)
secretary = random.choice(names)

# Step 5: Print the selected members
print("President:", president)
print("Treasurer:", treasurer)
print("Secretary:", secretary)
```

Note: The above code assumes that the names in the "MEMBERS.TXT" file are stored on separate lines. If the file is formatted differently, you may need to modify the code to suit your specific format.