{"id":154332,"date":"2018-02-20T23:50:30","date_gmt":"2018-02-20T23:50:30","guid":{"rendered":"https:\/\/writemyessayfree.com\/jamesblent"},"modified":"2017-08-17T18:23:23","modified_gmt":"2017-08-17T18:23:23","slug":"jamesblent","status":"publish","type":"post","link":"https:\/\/www.benedictsol.com\/blogs\/jamesblent\/","title":{"rendered":"Jamesblent"},"content":{"rendered":"<p align=\"center\"><b>Programming Assignment 6 Instructions<\/b><\/p>\n<p>Adapted from Introduction to Programming Using Visual Basic 2012, 9\/E, <strong>David I. Schneider.<\/strong><strong><\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>The figures below show the output of a Visual Basic program that displays information about Bachelor degrees conferred in 1981 and 2006, the percentage of change, and a histogram for the 2006 data.&nbsp; Create this program using arrays.&nbsp; The program should allow a user to display any of these tables as an option and to quit as a fourth option.&nbsp; The first table is ordered alphabetically by field of study.&nbsp; The second table is ordered by decreasing percentages, and the last table is ordered by increasing number of degrees.<\/strong><strong><\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Deliverables:<\/strong><strong><\/strong><\/p>\n<ol>\n<li><strong>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Write a Visual Basic program that displays the information below.<\/strong><strong><\/strong><\/li>\n<li><strong>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Do not prompt the user to enter the degree information.&nbsp; <\/strong><strong><\/strong><\/li>\n<li><strong>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Use the information below to populate your arrays.<\/strong><strong><\/strong><\/li>\n<li><strong>4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Use a DataGridView control to display the data.<\/strong><strong><\/strong><\/li>\n<li><strong>5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Order the data as described above.<\/strong><strong><\/strong><\/li>\n<li><strong>6.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Use appropriate software development guidelines, such as clearing the grid before populating it with new data when a button is clicked and including a title on the form.<\/strong><strong><\/strong><\/li>\n<\/ol>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Note:&nbsp; The histogram displays one asterisk for every 10,000 degrees conferred.<\/strong><strong><\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>&nbsp;<\/strong><b style=\"line-height: 1.5\">Programming Assignment 7 Instructions<\/b><\/p>\n<p>Adapted from Introduction to Programming Using Visual Basic 2012, 9\/E, <strong>David I. Schneider.<\/strong><strong><\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Create and Maintain Telephone Directories<\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Write a Visual Basic program to create and maintain telephone directories.&nbsp; Each telephone directory should be contained in a separate text file.&nbsp; In addition, a file named Directories.txt should hold the names of the telephone directories.&nbsp; At any time, names of all the telephone directories should be displayed in a list box.&nbsp; After a telephone directory is selected, it becomes the current phone directory.&nbsp; The following buttons should be available. <\/strong><strong><\/strong><\/p>\n<ol>\n<li><strong>a.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Create a new telephone directory. (The filename should be provided by an input dialog box.)&nbsp; A new text file should be created for the directory, and the name of the new directory should be added to the Directories.txt file.&nbsp; The Phone Directories listbox should immediately be refreshed to reflect the new directory, and the new directory should be automatically seleted from the listbox.&nbsp; Note that this selection should trigger the procedure that sets the current directory and updates the contents of the current directory textbox.&nbsp; Also note that the list of directories is displayed in ascending order in the listbox.<\/strong><strong><\/strong><\/li>\n<li><strong>b.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Add a listing (as given in textboxes) to the end of the current phone directory.&nbsp; This action should update the text file containing the listings of the current directory and refresh the grid to display the newly added listing.<\/strong><strong><\/strong><\/li>\n<li><strong>c.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Delete a name (as specified in the \u201cName\u201d text box) from the current phone directory.&nbsp; This action should update the text file containing the listings of the current directory.&nbsp; As is good software development practice, you should prompt the user with a messagebox that allows him to confirm the deletion before any permanent action is taken to delete the entry from the file.&nbsp; The grid should also refresh to show the removal of the listing.<\/strong><strong><\/strong><\/li>\n<li><strong>d.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Display the names and phone numbers in the current phone directory.&nbsp; (Note that the listings are displayed in ascending order in the table.)<\/strong><strong><\/strong><\/li>\n<\/ol>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Design your form as depicted in the diagram below.<\/strong><strong><\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Helpful hints:<\/strong><\/p>\n<ol>\n<li><strong>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>The text files needed for this assignment should be placed in the bindebug folder of the project.<\/strong><strong><\/strong><\/li>\n<li><strong>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>When the form opens, populate the directories listbox with the names of the directories.<\/strong><strong><\/strong><\/li>\n<li><strong>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Use an array and IO.ReadAllLines to populate the array with the list of directories.<\/strong><strong><\/strong><\/li>\n<li><strong>Use the StreamWriterin conjunction with <\/strong>IO.File.AppendText and IO.File.CreateText to append new directories and create new text files. (Note: You will need to use the WriteLine method to write the name of the new file to Directories.txt.)<\/li>\n<li>When the user clicks the Create a New Phone Directory button, prompt him to enter the name using an InputBox.&nbsp; If the user fails to enter a name, display a message to him (i.e. \u201cInvalid directory name\u201d), and do not proceed to create a new directory.&nbsp; If the operation is successful, make the new directory the current directory.<\/li>\n<li><strong>6.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Before adding a new directory, make sure it doesn\u2019t already exist. You may find it helpful to use Array.IndexOf in your check.<\/strong><strong><\/strong><\/li>\n<li><strong>7.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>To display the contents of the directories file, use a LINQ query.&nbsp; Loop over all of the items in the query using a For each statement to populate the listbox.<\/strong><strong><\/strong><\/li>\n<li><strong>8.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Before displaying the contents of the directories file, make sure the file exists first.&nbsp; You will need to use the IO.File.Exists method in your check.<\/strong><strong><\/strong><\/li>\n<li><strong>9.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><strong>Use good programming practices by clearing the listbox and table before refreshing them when a change is made that affects their contents.<\/strong><strong><\/strong><\/li>\n<li><strong>10.&nbsp; <\/strong><strong>Remember to close the files after accessing them.<\/strong><strong><\/strong><\/li>\n<li><strong>11.&nbsp; <\/strong><strong>To remove a listing from a directory, you may find this code helpful as it selects only those records in the file that are <i>not<\/i> the one the user wants to remove.&nbsp; The code should then write the results of this query back to the file:<\/strong><strong><\/strong><\/li>\n<\/ol>\n<p>Dim query = From line InIO.File.ReadAllLines(fileName)<\/p>\n<p>Let name = line.Split(\u201c,\u201dc)(0)<\/p>\n<p>LetphoneNum = line.Split(\u201c,\u201dc)(1)<\/p>\n<p>Where name &lt;&gt;txtName.Text<\/p>\n<p>Select name &amp;\u201d,\u201d&amp;phoneNum<\/p>\n<p>IO.File.WriteAllLines(fileName, query.ToArray)<\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li><strong>12.&nbsp; <\/strong><strong>Use a DataViewGrid control to display the contents of a specific directory.<\/strong><strong><\/strong><\/li>\n<li><strong>13.&nbsp; <\/strong><strong>Include appropriate error checking (i.e. check for blank names, phone numbers, etc.)<\/strong><strong><\/strong><\/li>\n<li><strong>14.&nbsp; <\/strong><strong>Use appropriate naming conventions for all controls.<\/strong><strong><\/strong><\/li>\n<\/ol>\n<p><strong>&nbsp;<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Programming Assignment 6 Instructions Adapted from Introduction to Programming Using Visual Basic 2012, 9\/E, David I. Schneider. &nbsp; The figures below show the output of a Visual Basic program that displays information about Bachelor degrees conferred in 1981 and 2006, <a href=\"https:\/\/www.benedictsol.com\/blogs\/jamesblent\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-154332","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/154332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/comments?post=154332"}],"version-history":[{"count":0,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/154332\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/media?parent=154332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/categories?post=154332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/tags?post=154332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}