Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Visual Basic Project to code the solution for the problem described below. Once completed, zip the entire VB Project and submit the .zip

Create a Visual Basic Project to code the solution for the problem described below. Once completed, zip the entire VB Project and submit the .zip file for this assignment.

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 1: 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 G-Rated). 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:

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 descending 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:

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 SortedItems.txt from the query results.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions