Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this lab, you are to create ONE project that contains one form for this assignment. The form and all controls should be named using
In this lab, you are to create ONE project that contains one form for this assignment. The form and all controls should be named using VB standards.
Within the code, using meaningful variable names that meet the VB standards and appropriate data types.
Comments are always encouraged.
Form : Working with single field array and LINQ:
This form will have five events: Load Event and four button click events four queries
Before you begin working on your code, you need to create a text file and name it Items.txt This text file should contain a list of string items of your choosing although you need to keep it GRated In the lecture sample code, I used flower names but you should create your own data list for this assignment. Each line should contain one word or phrase value were not working with csv records for this assignment
Programming Note: The output listbox should be cleared prior to having new information displayed to it I.e Within each button click event, before you begin adding information to the listbox, clear out any lines that may be there from previous events.
This program will work with a class level array named items that needs to be created before the events can work with it
Load Event:
At Load time, use the ReadAllLines command to read the records that make up the Items.txt file into the items array. Aka Populate the items array from the text file. Once the items array has been populate, each item in the array should be displayed in the output listbox. This is to be done at Load time too.
First Button Click Event:
This event must use a LINQ to search the items array for a value that the user provides. Have the user enter an item to search for via an InputBox. Use a LINQ to determine if that item is in the items array. The search shouldnt require a case match to be consider a match so use ToUpper or ToLower CLEAR the listbox. If the item is found, a meaningful message should be displayed in the listbox to let the user know. If the item is not found, a different meaningful message should be displayed in the listbox.
Second Button Click Event:
This event must use a LINQ to pull out the just the first letter of each line and put the values in ascending order.
CLEAR the listbox. Display all letters that make up the query results. After all letters have been listed, use the First and Last methods to display the first letter and the last letter along with meaningful text explaining what these letters are. See sample below:
FirstLetter Query.jpg
Third Button Click Event:
This event must use a LINQ to create a query result that includes of lengths of each item. The length values should be put in ascending order and any duplicate values should be removed.
CLEAR the listbox. Display all numbers that make up the query results. After all numbers have been listed, use the Max and Min methods to display the lowest number and the highest number along with meaningful text explaining what these numbers are. Since the values in this query result are numeric, also use the Sum and Average methods and display the results of these along with meaningful text. See sample below:
Length Query.jpg
Fourth Button Click Event:
This event must use a LINQ to will sort the items in Ascending order and create a new file. Once the query has executed, CLEAR the listbox and display the contents of the query in the listbox. Then create a new file named SortedItemstxt from the query results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started