it's a all about basic coding on visual studio

Anonymous

Question Description

All the instructions are below. It comes with a template

Unformatted Attachment Preview

Programming Assignment 5 Instructions Ephesians 4:11 “So Christ himself gave the apostles, the prophets, the evangelists, the pastors, and teachers, to equip his people for works of service, so that the body of Christ may be built up until we all reach unity in the faith and in the knowledge of the Son of God and become mature, attaining to the whole measure of the fullness of Christ.” It is important to not only worship together but to serve Christ together in unity. You have been asked to provide a program to your church which allow them to keep track of the members who belong to different groups. To do this they need to have the ability to display files, add members, and delete members. The information they have is stored in individual text files. The application should open the Youth_Members.txt file on the load. The menu item File contains the second-level menu item Exit, which exits the application. The menu item Sort contains the two second-level menu items Ascending and Descending. The menu item Edit contains the two second-level menu items Create File, Add Member, Delete Member. 1. Form Setup a. You must save your project using your initials in the name** This is required and the project will not be accepted otherwise. b. Design your screen to look like the one below. c. Update the backcolor to the color of your choice. d. Use appropriate naming conventions for controls and variables. e. Lock the controls on the form. f. The count text box must be set to read only and the user should not be able to tab to the text box. g. Include shortcuts and access keys for each menu item (such as Ctrl-X for Exit, Ctrl-A for Ascending, etc.) 2. Code a. Create a comment section at the beginning of the code with the name of the assignment, purpose of the assignment, and your name. Comments must be throughout each sub of the application. b. Remove any subs that are not utilized by the program c. The text file, Youth_Members.txt is included in your Instructions folder and should be stored in your project’s bin\debug folder. d. ****This step must be included for your assignment to be accepted. You must include three other rows in the file that include your name, your instructor’s name, and another name with the appropriate data e. The application opens with the Youth_Members.txt file loaded in the listbox. 3. File Menu a. When the file menu is pressed the Exit submenu is displayed b. When the user clicks on the Exit menu, the application closes 4. Edit Menu a. When the user clicks on the Edit menu, the following menus are presented: Create File, Add Member, Delete Member b. When the user clicks on Create file, the user will be presented with an input box to enter a name of a file. An if statement is utilized to make sure a name is entered. If successful the program creates a blank file and displays the blank file in the textbox. The count is updated. c. When the user clicks on the Add Member, the user will be presented with an input box to enter a new member name. Use an if statement to make sure the name is not null. If successful, the application appends the name to the current file that is loaded. The listbox is refreshed with the new file along with the count being updated. d. When the user clicks on the Delete Member, the application will verify with an if statement if a name is selected in the listbox. If a name is not selected the user is presented with an error message and the program quits. If a name is selected, the name is removed from the file and the listbox is refreshed with the new file along with the count being updated. 5. Sort Menu a. When the user clicks on the Sort menu, the Ascending and Descending menu are displayed. b. When the user clicks the Ascending menu or Descending menu, the user sorts the array in ascending or descending order based on what the user selects. The user is not to sort using the listbox property sort. 6. Refresh Sub a. This sub is called with every update including the add and delete of a person, and creation of file. b. The sub will refresh the listbox c. The sub will determine the count of the items in the listbox and refresh the count text box. Youth members: Christopher Woods Brayden Bost Mary Freyer Emma Elliott Stewart Trunball Anna Kate Jackson This assignment is due by 11:59 p.m. (ET) on Monday of Module/Week 5. Public Class frmAssignment5 Dim textfile As String = "Youth_Members.txt" Private Sub updatecount() txtCount.Text = lstMembers.Items.Count() End Sub Explain the following sub: Private Sub mnuCreate_Click(sender As Object, e As EventArgs) Handles mnuCreate.Click Dim nametocreate = InputBox("Please enter name of file to create") textfile = nametocreate & ".txt" If Not IO.File.Exists(textfile) Then Add code to create a new file (Hint: This should be a single line of code) sw.Close() End If refreshlstbox() End Sub Explain the following sub: Private Sub mnuAddMem_Click(sender As Object, e As EventArgs) Handles mnuAddMem.Click Dim newmember = InputBox("Please enter a new member") Dim sw As IO.StreamWriter Try Add the code to add a new member refreshlstbox() Catch exc As System.ArgumentNullException MessageBox.Show("Are you sure you have a file open to add to?") Catch exc As IO.IOException MessageBox.Show("Testing") End Try End Sub Explain the following sub: Sub refreshlstbox() lstMembers.DataSource = IO.File.ReadAllLines(textfile) lstMembers.SelectedItem = Nothing txtCount.Text = lstMembers.Items.Count() End Sub Explain the following sub: Private Sub mnuDeleteMem_Click(sender As Object, e As EventArgs) Handles mnuDeleteMem.Click If lstMembers.SelectedIndex = -1 Then MessageBox.Show("You must select a member to delete") Return End If Explain the following 5 lines of code: Dim deleteMember As String = lstMembers.SelectedItem Dim queryDelete = From personAvailable In IO.File.ReadAllLines(textfile) Where personAvailable <> deleteMember Select personAvailable IO.File.WriteAllLines(textfile, queryDelete) refreshlstbox() End Sub Private Sub mnuExit_Click(sender As Object, e As EventArgs) Handles mnuExit.Click Me.Close() End Sub Explain the following sub: Private Sub mnuAscend_Click(sender As Object, e As EventArgs) Handles mnuAscend.Click Dim querydisplay = From members In IO.File.ReadAllLines(textfile) Order By members Ascending Select members lstMembers.DataSource = querydisplay.ToList() End Sub Explain the following sub: Private Sub mnuDescend_Click(sender As Object, e As EventArgs) Handles mnuDescend.Click Write the code for sorting using descending order. End Sub Private Sub frmAssignment5_Load(sender As Object, e As EventArgs) Handles MyBase.Load refreshlstbox() End Sub End Classfup ...
Purchase answer to see full attachment

Tutor Answer

TutorDLoise
School: UT Austin

Cool. I have attached a zipped file with the code and an extra word doc file containing the code for the project. Kindly let me know if anything is not clear.

Running Head: VISUAL BASIC CODE

1

Name
Institution Affiliate
Tutor
Date

Running Head: VISUAL BASIC CODE

Imports System.IO
Imports System.Text
Public Class frmAssignment5
Dim textfile As String = "Youth_Members.txt"
Dim sw As IO.StreamWriter
Private Sub updatecount()
txtCount.Text = lstMembers.Items.Count()
End Sub
'This sub checks the input for ant text
'if its not empty it creates a new txt file with the name
'If it is empty,it returns a messsage box showing its empty
Private Sub mnuCreate_Click(sender As Object, e As EventArgs) Handles mnuCreate.Click
Dim fs As FileStream =...

flag Report DMCA
Review

Anonymous
Top quality work from this guy! I'll be back!

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors