100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
ICT3611 Assignment 11 Answers R292,00
Add to cart

Other

ICT3611 Assignment 11 Answers

 60 views  0 purchase

ICT3611 Assignment 11 Answers

Preview 1 out of 13  pages

  • August 27, 2021
  • 13
  • 2021/2022
  • Other
  • Unknown
All documents for this subject (3)
avatar-seller
hlogzaogza
Chapter 3 - Programming Project 1 - Membership List
CODE
Public Class Form1
Dim file() As String = IO.File.ReadAllLines("Phones.txt")
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
Display()
End Sub

Private Sub lstMembers_SelectedIndexChanged(sender As Object, e As
EventArgs) Handles lstMembers.SelectedIndexChanged
'loop through the file and find name that matches the selected text
in the list box
'and return the name and appropriate phone number
Dim query = From p In file
Let name As String = p.ToString.Split(",")(0)
Let phone = p.ToString.Split(",")(1)
Where name = lstMembers.SelectedItem
Select name, phone

txtName.Text = query.ToList.First.name.ToString
mtbPhone.Text = query.ToList.First.phone.ToString
End Sub

Private Sub mnuAdd_Click(sender As Object, e As EventArgs) Handles
mnuAdd.Click
'if name has been entered into text boxes, append it to the file
If (txtName.Text <> "") And (mtbPhone.Text <> "") Then
ReDim Preserve file(file.Count) 'add one more index to array
file(file.Count - 1) = txtName.Text + "," + mtbPhone.Text
Display()
Else
MessageBox.Show("Nothing to add")
End If
End Sub

Private Sub mnuDelete_Click(sender As Object, e As EventArgs) Handles
mnuDelete.Click
Dim nameToDelete As String = lstMembers.SelectedItem

'we're deleting, so array now holds one less name than is in the
current file
Dim tempName(lstMembers.Items.Count - 2) As String

If nameToDelete <> "" Then
'select name to delete
Dim query = From n In file
Let name As String = n.Split(",")(0)
Where name <> nameToDelete
Select n

'write the temp data into array and display new list

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller hlogzaogza. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R292,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

53022 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R292,00
  • (0)
Add to cart
Added