Question

The file Nations.txt contains the names of the 193 member nations of the United Nations. Write a program that loads the file

Must be done with Visual Studio. please run the programs and provide the codes that made it possible

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output will be like:

Form 1 Mal Macedonia Madagascar Malawi Malaysia Maldives Mali Marshall Islands Mauritania Mauritius Mexico Micronesia Moldova

Code will be like:

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Linq
Imports System.Windows.Forms
Imports System.IO
Imports System.Text.RegularExpressions

Private arr As String() = New String(195) {}
Private count As Integer = 0

Using reader As StreamReader = New StreamReader("TextFile1.txt")

While True
Dim line As String = reader.ReadLine()

If line Is Nothing Then
Exit While
End If

arr(count) = line
count += 1
End While
End Using
End Sub

Private Sub textBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim searchWord As String = textBox1.Text

For i As Integer = 0 To arr.Length - 1

If arr(i).Contains(searchWord) Then
richTextBox1.Text += arr(i)
richTextBox1.Text += Environment.NewLine
End If
Next
End Sub
End Class

Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.

Add a comment
Know the answer?
Add Answer to:
Must be done with Visual Studio. please run the programs and provide the codes that made it possible
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • DATA: # happy2.py import csv def main(): happy_dict = make_happy_dict() print_sorted_dictionary(happy_dict) def make_happy_dict(): filename = "happiness.csv"...

    DATA: # happy2.py import csv def main(): happy_dict = make_happy_dict() print_sorted_dictionary(happy_dict) def make_happy_dict(): filename = "happiness.csv" happy_dict={} with open(filename, 'r') as infile: csv_happy = csv.reader(infile) infile.readline() for line in csv_happy: happy_dict[line[0]] = line[2]       return happy_dict def lookup_happiness_by_country(happy_dict): return def print_sorted_dictionary(D): if type(D) != type({}): print("Dictionary not found") return print("Contents of dictionary sorted by key.") print("Key","Value") for key in sorted(D.keys()): print(key, D[key]) main() "happines.csv" Country,Year of Estimate,Happiness Index Afghanistan,2018,2.694303274 Albania,2018,5.004402637 Algeria,2018,5.043086052 Angola,2014,3.794837952 Argentina,2018,5.792796612 Armenia,2018,5.062448502 Australia,2018,7.17699337 Austria,2018,7.396001816 Azerbaijan,2018,5.167995453 Bahrain,2017,6.227320671 Bangladesh,2018,4.499217033...

  • Will reward thumbs up 100% if works. thank you Pickling with Python code and Pandas code Do both ...

    Will reward thumbs up 100% if works. thank you Pickling with Python code and Pandas code Do both pickling assignment in one Jupyter Notebook file. Python Pickle steps: Download the CSV file. Load into a Pandas DataFrame. Make the column ‘country’ the index. Print the header. Using Python code, pickle the DataFrame and name the file: PythonPickle. Load back the PythonPickle data into the DataFrame. Print the header. (Note both printed headers should match.) Pandas Pickle steps: Download the CSV...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT