SlideShare a Scribd company logo
1 of 11
Download to read offline
For C# need to make these changes to this programm, http://pastebin.com/nBsBETd8
For this assignment, rewrite the CS7 Array to use a string typed List.
Review the CS7 Arrays program.
The main changes to make to CS7 Arrays to complete your assignment include:
The function names may stay the same.
Change the declaration of cstrName[] to List cstrName = new List( );
The variable cintNumberOfNames will not be needed because cstrName.Count can be used.
In CS7Form_Load:
Delete int i = 0;
The if-else statement to check if the array size has been exceeded is not needed since lists can
grow.
Use the Add method to load the names in the list,
cstrName.Add(nameStreamReader.ReadLine());
The names still need to be displayed in the listbox after the list is loaded.
In displayNames( ) change cintNumberOfNames to cstrName.Count.
In btnSortByName, all of the logic can be replaced with a call to Sort, cstrName.Sort(); The
names have to be redisplayed after the sort.
In btnSearchByName:
Declare a varible to store the result of the search, int intIndex;
Call btnSortByName to sort and redisplay the array just in case it hasn't be sorted.
Use the BinarySearch method to conduct the search,
intIndex = cstrName.BinarySearch(txtSearchName.Text);
A negative value is returned if the value is not found, else the zero-based index of the element is
returned. In the statement above, the result is stored in intIndex. intIndex could then be checked
if the result is >= zero, such as if (intIndex >= 0 )
Use the result to display a message if the name was not found, else select the matching entry in
listbox and display a message indicating the name was found.
In btnDelete use the RemoveAt method to delete the name at the top of the list. Before calling
RemoveAt, check that Count is greater than zero to avoid a run-time exception. The names have
to be redisplayed after removing a name.
here is the code,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//Project: CS7 Array Processing
//Programmer: Daryl Austin
//Description: Declare and load an array with a list of names.
// The user can sort the list by name and search by name.
// Names can be deleted from the top of the list.
using System.IO; // FileStream and StreamReader
namespace CS7
{
public partial class CS7Form : Form
{
public CS7Form()
{
InitializeComponent();
}
//Declare class-level arrays
//Array can hold up to 10 names.
string[] cstrName = new string[9];
//Use cintNumberOfCustomers to process array because array
//may be partially loaded. Count set in CS7Form_Load
int cintNumberOfNames;
private void CS7Form_Load(object sender, EventArgs e)
{
int i = 0; // subscript initialized to zero
try
{
//Load the array with the data in the file
FileStream nameFile = new FileStream("cs7.txt", FileMode.Open);
StreamReader nameStreamReader = new StreamReader(nameFile);
while (nameStreamReader.Peek() != -1)
{
if (i < cstrName.Length)
{
cstrName[i] = nameStreamReader.ReadLine();
i += 1; //Increment subscript by one
}
else
{
MessageBox.Show
("Error: Notify Programmer Array Size Exceeded. ",
"Array Size Exceeded", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
break; //Get of out of loop; Arrays are full.
}//End If
}//End Loop
nameFile.Close(); //Close file
}
catch (Exception ex)
{
MessageBox.Show("Error Opening File. Data not loaded " + ex.Message,
"File Not Found",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
cintNumberOfNames = i; //Save how many students were loaded
displayNames(); //display names in list box
}
void displayNames()
{
int i;
//Listboxes need to be cleared because this procedure is also
//called to redisplayed the data
lstName.Items.Clear();
//Use cintNumberOfnames to process a partially filled array
//cintNumberOfnames is like Length, so we need to subtract one
//to get the subscript value of the last entry.
for (i = 0; i < cintNumberOfNames; i++)
{
lstName.Items.Add(cstrName[i]);
}//next i - name
}
private void btnSortByName_Click(object sender, EventArgs e)
{
//Sort by name using a Simple Selection sort
int i;
int i2;
string strHoldValue;
string strMinName;
int intMinSubscript;
//outer loop keeps track of where the next value
//should be placed.
for (i = 0; i < cintNumberOfNames - 1; i++)
{
intMinSubscript = i;
strMinName = cstrName[i];
//inner loop finds the lowest value to move up
for (i2 = i + 1; i2 < cintNumberOfNames; i2++)
{
//Only == and != can be used with strings, use CompareTo
if (cstrName[i2].CompareTo(strMinName) < 0)
{
//save the new low value found
strMinName = cstrName[i2];
intMinSubscript = i2;
}
}//next i2
strHoldValue = cstrName[i];
cstrName[i] = cstrName[intMinSubscript];
cstrName[intMinSubscript] = strHoldValue;
}//next i
//display names in list box
displayNames();
}
private void btnSearchByName_Click(object sender, EventArgs e)
{
int i;
bool blnNameFound = false;
//array must be sorted ascending for early exit logic to work
btnSortByName_Click(sender, e);
for (i = 0; i < cintNumberOfNames; i++)
{
//case sensitive comparison
if (txtSearchName.Text == cstrName[i])
{
blnNameFound = true;
txtSearchResults.Text = "Matching name is selected in list box.";
lstName.SelectedIndex = i;
break; //exit for loop
}
}//next i
if (blnNameFound == false)
{
txtSearchResults.Text = "Match not found - Reached end of array";
}
}
private void btnDelete_Click(object sender, EventArgs e)
{
int i;
int i2;
for (i = 0; i < cintNumberOfNames; i++)
{
//move names up one posistion
i2 = i + 1;
cstrName[i] = cstrName[i2];
}
//If the count is > 0 subtract one and redisplay names in list box
if (cintNumberOfNames > 0)
{
//substract one from the count
cintNumberOfNames -= 1;
//display names in list box
displayNames();
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}//end of class
}//end of namespace
Solution
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//Project: CS7 Array Processing
//Programmer: Daryl Austin
//Description: Declare and load an array with a list of names.
// The user can sort the list by name and search by name.
// Names can be deleted from the top of the list.
using System.IO; // FileStream and StreamReader
namespace CS7
{
public partial class CS7Form : Form
{
public CS7Form()
{
InitializeComponent();
}
//Declare class-level arrays
//Array can hold up to 10 names.
string[] cstrName = new string[9];
//Use cintNumberOfCustomers to process array because array
//may be partially loaded. Count set in CS7Form_Load
int cintNumberOfNames;
private void CS7Form_Load(object sender, EventArgs e)
{
int i = 0; // subscript initialized to zero
try
{
//Load the array with the data in the file
FileStream nameFile = new FileStream("cs7.txt", FileMode.Open);
StreamReader nameStreamReader = new StreamReader(nameFile);
while (nameStreamReader.Peek() != -1)
{
if (i < cstrName.Length)
{
cstrName[i] = nameStreamReader.ReadLine();
i += 1; //Increment subscript by one
}
else
{
MessageBox.Show
("Error: Notify Programmer Array Size Exceeded. ",
"Array Size Exceeded", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
break; //Get of out of loop; Arrays are full.
}//End If
}//End Loop
nameFile.Close(); //Close file
}
catch (Exception ex)
{
MessageBox.Show("Error Opening File. Data not loaded " + ex.Message,
"File Not Found",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
cintNumberOfNames = i; //Save how many students were loaded
displayNames(); //display names in list box
}
void displayNames()
{
int i;
//Listboxes need to be cleared because this procedure is also
//called to redisplayed the data
lstName.Items.Clear();
//Use cintNumberOfnames to process a partially filled array
//cintNumberOfnames is like Length, so we need to subtract one
//to get the subscript value of the last entry.
for (i = 0; i < cintNumberOfNames; i++)
{
lstName.Items.Add(cstrName[i]);
}//next i - name
}
private void btnSortByName_Click(object sender, EventArgs e)
{
//Sort by name using a Simple Selection sort
int i;
int i2;
string strHoldValue;
string strMinName;
int intMinSubscript;
//outer loop keeps track of where the next value
//should be placed.
for (i = 0; i < cintNumberOfNames - 1; i++)
{
intMinSubscript = i;
strMinName = cstrName[i];
//inner loop finds the lowest value to move up
for (i2 = i + 1; i2 < cintNumberOfNames; i2++)
{
//Only == and != can be used with strings, use CompareTo
if (cstrName[i2].CompareTo(strMinName) < 0)
{
//save the new low value found
strMinName = cstrName[i2];
intMinSubscript = i2;
}
}
strHoldValue = cstrName[i];
cstrName[i] = cstrName[intMinSubscript];
cstrName[intMinSubscript] = strHoldValue;
}
//display names in list box
displayNames();
}
private void btnSearchByName_Click(object sender, EventArgs e)
{
int i;
bool blnNameFound = false;
//array must be sorted ascending for early exit logic to work
btnSortByName_Click(sender, e);
for (i = 0; i < cintNumberOfNames; i++)
{
//case sensitive comparison
if (txtSearchName.Text == cstrName[i])
{
blnNameFound = true;
txtSearchResults.Text = "Matching name is selected in list box.";
lstName.SelectedIndex = i;
break; //exit for loop
}
}//next i
if (blnNameFound == false)
{
txtSearchResults.Text = "Match not found - Reached end of array";
}
}
private void btnDelete_Click(object sender, EventArgs e)
{
int i;
int i2;
for (i = 0; i < cintNumberOfNames; i++)
{
//move names up one posistion
i2 = i + 1;
cstrName[i] = cstrName[i2];
}
//If the count is > 0 subtract one and redisplay names in list box
if (cintNumberOfNames > 0)
{
//substract one from the count
cintNumberOfNames -= 1;
//display names in list box
displayNames();
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}//end of class
}//end of namespace

More Related Content

Similar to For C# need to make these changes to this programm, httppastebin..pdf

In C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdfIn C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdffantoosh1
 
In C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfIn C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfflashfashioncasualwe
 
Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdfInspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdfvishalateen
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdfaathmaproducts
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdffeelinggift
 
Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdfaathiauto
 
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdfJAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdfarpaqindia
 
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 Sorted number list implementation with linked listsStep 1 Inspec.pdf Sorted number list implementation with linked listsStep 1 Inspec.pdf
Sorted number list implementation with linked listsStep 1 Inspec.pdfalmaniaeyewear
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfformicreation
 
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
Getting the following errorsError 1 error C2436 {ctor}  mem.pdfGetting the following errorsError 1 error C2436 {ctor}  mem.pdf
Getting the following errorsError 1 error C2436 {ctor} mem.pdfherminaherman
 
how do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdfhow do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdffootwearpark
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfinfo114
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdffreddysarabia1
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfAroraRajinder1
 
maincpp Build and procees a sorted linked list of Patie.pdf
maincpp   Build and procees a sorted linked list of Patie.pdfmaincpp   Build and procees a sorted linked list of Patie.pdf
maincpp Build and procees a sorted linked list of Patie.pdfadityastores21
 
Note             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfNote             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfAnkitchhabra28
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfdhavalbl38
 

Similar to For C# need to make these changes to this programm, httppastebin..pdf (20)

In C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdfIn C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdf
 
In C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfIn C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdf
 
Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdfInspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdf
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdf
 
Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdf
 
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdfJAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
 
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 Sorted number list implementation with linked listsStep 1 Inspec.pdf Sorted number list implementation with linked listsStep 1 Inspec.pdf
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
 
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
Getting the following errorsError 1 error C2436 {ctor}  mem.pdfGetting the following errorsError 1 error C2436 {ctor}  mem.pdf
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
 
how do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdfhow do i expand upon selectionSortType so that you are no longer bou.pdf
how do i expand upon selectionSortType so that you are no longer bou.pdf
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
 
Whats New In C# 3.0
Whats New In C# 3.0Whats New In C# 3.0
Whats New In C# 3.0
 
iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
maincpp Build and procees a sorted linked list of Patie.pdf
maincpp   Build and procees a sorted linked list of Patie.pdfmaincpp   Build and procees a sorted linked list of Patie.pdf
maincpp Build and procees a sorted linked list of Patie.pdf
 
Mysql1
Mysql1Mysql1
Mysql1
 
Note             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdfNote             Given Code modified as required and required met.pdf
Note             Given Code modified as required and required met.pdf
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdf
 

More from fathimafancyjeweller

Write a Python program that extracts 1000 unique links from Twitter .pdf
Write a Python program that extracts 1000 unique links from Twitter .pdfWrite a Python program that extracts 1000 unique links from Twitter .pdf
Write a Python program that extracts 1000 unique links from Twitter .pdffathimafancyjeweller
 
Which of the following statements about financial intermediaries is .pdf
Which of the following statements about financial intermediaries is .pdfWhich of the following statements about financial intermediaries is .pdf
Which of the following statements about financial intermediaries is .pdffathimafancyjeweller
 
Why must each network router interface belong to a different network.pdf
Why must each network router interface belong to a different network.pdfWhy must each network router interface belong to a different network.pdf
Why must each network router interface belong to a different network.pdffathimafancyjeweller
 
What are the similarities and differences between the seppuku of the.pdf
What are the similarities and differences between the seppuku of the.pdfWhat are the similarities and differences between the seppuku of the.pdf
What are the similarities and differences between the seppuku of the.pdffathimafancyjeweller
 
Which of the following are considered withdrawals from an economy.pdf
Which of the following are considered withdrawals from an economy.pdfWhich of the following are considered withdrawals from an economy.pdf
Which of the following are considered withdrawals from an economy.pdffathimafancyjeweller
 
What measures have the EU (or member nations) taken to mitigate the .pdf
What measures have the EU (or member nations) taken to mitigate the .pdfWhat measures have the EU (or member nations) taken to mitigate the .pdf
What measures have the EU (or member nations) taken to mitigate the .pdffathimafancyjeweller
 
What types of powers are given to the states by the Constitution.pdf
What types of powers are given to the states by the Constitution.pdfWhat types of powers are given to the states by the Constitution.pdf
What types of powers are given to the states by the Constitution.pdffathimafancyjeweller
 
Using the balanced equations given below, determine the overall mola.pdf
Using the balanced equations given below, determine the overall mola.pdfUsing the balanced equations given below, determine the overall mola.pdf
Using the balanced equations given below, determine the overall mola.pdffathimafancyjeweller
 
True or false Income statement profit and loss statement shows com.pdf
True or false Income statement profit and loss statement shows com.pdfTrue or false Income statement profit and loss statement shows com.pdf
True or false Income statement profit and loss statement shows com.pdffathimafancyjeweller
 
Thomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdf
Thomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdfThomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdf
Thomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdffathimafancyjeweller
 
The government uses part of payroll taxes to pay for Social Security..pdf
The government uses part of payroll taxes to pay for Social Security..pdfThe government uses part of payroll taxes to pay for Social Security..pdf
The government uses part of payroll taxes to pay for Social Security..pdffathimafancyjeweller
 
The financial statements are prepared from the unadjusted trial balan.pdf
The financial statements are prepared from the unadjusted trial balan.pdfThe financial statements are prepared from the unadjusted trial balan.pdf
The financial statements are prepared from the unadjusted trial balan.pdffathimafancyjeweller
 
Should the US conform to international standardsSolutionYes, .pdf
Should the US conform to international standardsSolutionYes, .pdfShould the US conform to international standardsSolutionYes, .pdf
Should the US conform to international standardsSolutionYes, .pdffathimafancyjeweller
 
Research and describe a tool that can be used to test for web server.pdf
Research and describe a tool that can be used to test for web server.pdfResearch and describe a tool that can be used to test for web server.pdf
Research and describe a tool that can be used to test for web server.pdffathimafancyjeweller
 
Question 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdf
Question 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdfQuestion 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdf
Question 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdffathimafancyjeweller
 
Question 1. Dscribe the change you observed when you added 1 mL of 0.pdf
Question 1. Dscribe the change you observed when you added 1 mL of 0.pdfQuestion 1. Dscribe the change you observed when you added 1 mL of 0.pdf
Question 1. Dscribe the change you observed when you added 1 mL of 0.pdffathimafancyjeweller
 
Prove that a group of order 255 is a cyclic.SolutionLet G be a .pdf
Prove that a group of order 255 is a cyclic.SolutionLet G be a .pdfProve that a group of order 255 is a cyclic.SolutionLet G be a .pdf
Prove that a group of order 255 is a cyclic.SolutionLet G be a .pdffathimafancyjeweller
 
Choose one field such as academia, health, consulting, business, man.pdf
Choose one field such as academia, health, consulting, business, man.pdfChoose one field such as academia, health, consulting, business, man.pdf
Choose one field such as academia, health, consulting, business, man.pdffathimafancyjeweller
 
An intercalating agent 1. Inserts between base pairs of the two str.pdf
An intercalating agent 1. Inserts between base pairs of the two str.pdfAn intercalating agent 1. Inserts between base pairs of the two str.pdf
An intercalating agent 1. Inserts between base pairs of the two str.pdffathimafancyjeweller
 
a trait is considered discrete when 1-The traits are intermediat.pdf
a trait is considered discrete when 1-The traits are intermediat.pdfa trait is considered discrete when 1-The traits are intermediat.pdf
a trait is considered discrete when 1-The traits are intermediat.pdffathimafancyjeweller
 

More from fathimafancyjeweller (20)

Write a Python program that extracts 1000 unique links from Twitter .pdf
Write a Python program that extracts 1000 unique links from Twitter .pdfWrite a Python program that extracts 1000 unique links from Twitter .pdf
Write a Python program that extracts 1000 unique links from Twitter .pdf
 
Which of the following statements about financial intermediaries is .pdf
Which of the following statements about financial intermediaries is .pdfWhich of the following statements about financial intermediaries is .pdf
Which of the following statements about financial intermediaries is .pdf
 
Why must each network router interface belong to a different network.pdf
Why must each network router interface belong to a different network.pdfWhy must each network router interface belong to a different network.pdf
Why must each network router interface belong to a different network.pdf
 
What are the similarities and differences between the seppuku of the.pdf
What are the similarities and differences between the seppuku of the.pdfWhat are the similarities and differences between the seppuku of the.pdf
What are the similarities and differences between the seppuku of the.pdf
 
Which of the following are considered withdrawals from an economy.pdf
Which of the following are considered withdrawals from an economy.pdfWhich of the following are considered withdrawals from an economy.pdf
Which of the following are considered withdrawals from an economy.pdf
 
What measures have the EU (or member nations) taken to mitigate the .pdf
What measures have the EU (or member nations) taken to mitigate the .pdfWhat measures have the EU (or member nations) taken to mitigate the .pdf
What measures have the EU (or member nations) taken to mitigate the .pdf
 
What types of powers are given to the states by the Constitution.pdf
What types of powers are given to the states by the Constitution.pdfWhat types of powers are given to the states by the Constitution.pdf
What types of powers are given to the states by the Constitution.pdf
 
Using the balanced equations given below, determine the overall mola.pdf
Using the balanced equations given below, determine the overall mola.pdfUsing the balanced equations given below, determine the overall mola.pdf
Using the balanced equations given below, determine the overall mola.pdf
 
True or false Income statement profit and loss statement shows com.pdf
True or false Income statement profit and loss statement shows com.pdfTrue or false Income statement profit and loss statement shows com.pdf
True or false Income statement profit and loss statement shows com.pdf
 
Thomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdf
Thomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdfThomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdf
Thomas Rinks and Joseph Shields developed Psycho Chihuahua, a carica.pdf
 
The government uses part of payroll taxes to pay for Social Security..pdf
The government uses part of payroll taxes to pay for Social Security..pdfThe government uses part of payroll taxes to pay for Social Security..pdf
The government uses part of payroll taxes to pay for Social Security..pdf
 
The financial statements are prepared from the unadjusted trial balan.pdf
The financial statements are prepared from the unadjusted trial balan.pdfThe financial statements are prepared from the unadjusted trial balan.pdf
The financial statements are prepared from the unadjusted trial balan.pdf
 
Should the US conform to international standardsSolutionYes, .pdf
Should the US conform to international standardsSolutionYes, .pdfShould the US conform to international standardsSolutionYes, .pdf
Should the US conform to international standardsSolutionYes, .pdf
 
Research and describe a tool that can be used to test for web server.pdf
Research and describe a tool that can be used to test for web server.pdfResearch and describe a tool that can be used to test for web server.pdf
Research and describe a tool that can be used to test for web server.pdf
 
Question 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdf
Question 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdfQuestion 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdf
Question 11 of 24 In E. coli, three structural Deand enzymes A. D, an.pdf
 
Question 1. Dscribe the change you observed when you added 1 mL of 0.pdf
Question 1. Dscribe the change you observed when you added 1 mL of 0.pdfQuestion 1. Dscribe the change you observed when you added 1 mL of 0.pdf
Question 1. Dscribe the change you observed when you added 1 mL of 0.pdf
 
Prove that a group of order 255 is a cyclic.SolutionLet G be a .pdf
Prove that a group of order 255 is a cyclic.SolutionLet G be a .pdfProve that a group of order 255 is a cyclic.SolutionLet G be a .pdf
Prove that a group of order 255 is a cyclic.SolutionLet G be a .pdf
 
Choose one field such as academia, health, consulting, business, man.pdf
Choose one field such as academia, health, consulting, business, man.pdfChoose one field such as academia, health, consulting, business, man.pdf
Choose one field such as academia, health, consulting, business, man.pdf
 
An intercalating agent 1. Inserts between base pairs of the two str.pdf
An intercalating agent 1. Inserts between base pairs of the two str.pdfAn intercalating agent 1. Inserts between base pairs of the two str.pdf
An intercalating agent 1. Inserts between base pairs of the two str.pdf
 
a trait is considered discrete when 1-The traits are intermediat.pdf
a trait is considered discrete when 1-The traits are intermediat.pdfa trait is considered discrete when 1-The traits are intermediat.pdf
a trait is considered discrete when 1-The traits are intermediat.pdf
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 

For C# need to make these changes to this programm, httppastebin..pdf

  • 1. For C# need to make these changes to this programm, http://pastebin.com/nBsBETd8 For this assignment, rewrite the CS7 Array to use a string typed List. Review the CS7 Arrays program. The main changes to make to CS7 Arrays to complete your assignment include: The function names may stay the same. Change the declaration of cstrName[] to List cstrName = new List( ); The variable cintNumberOfNames will not be needed because cstrName.Count can be used. In CS7Form_Load: Delete int i = 0; The if-else statement to check if the array size has been exceeded is not needed since lists can grow. Use the Add method to load the names in the list, cstrName.Add(nameStreamReader.ReadLine()); The names still need to be displayed in the listbox after the list is loaded. In displayNames( ) change cintNumberOfNames to cstrName.Count. In btnSortByName, all of the logic can be replaced with a call to Sort, cstrName.Sort(); The names have to be redisplayed after the sort. In btnSearchByName: Declare a varible to store the result of the search, int intIndex; Call btnSortByName to sort and redisplay the array just in case it hasn't be sorted. Use the BinarySearch method to conduct the search, intIndex = cstrName.BinarySearch(txtSearchName.Text); A negative value is returned if the value is not found, else the zero-based index of the element is returned. In the statement above, the result is stored in intIndex. intIndex could then be checked if the result is >= zero, such as if (intIndex >= 0 ) Use the result to display a message if the name was not found, else select the matching entry in listbox and display a message indicating the name was found. In btnDelete use the RemoveAt method to delete the name at the top of the list. Before calling RemoveAt, check that Count is greater than zero to avoid a run-time exception. The names have to be redisplayed after removing a name. here is the code, using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;
  • 2. using System.Drawing; using System.Text; using System.Windows.Forms; //Project: CS7 Array Processing //Programmer: Daryl Austin //Description: Declare and load an array with a list of names. // The user can sort the list by name and search by name. // Names can be deleted from the top of the list. using System.IO; // FileStream and StreamReader namespace CS7 { public partial class CS7Form : Form { public CS7Form() { InitializeComponent(); } //Declare class-level arrays //Array can hold up to 10 names. string[] cstrName = new string[9]; //Use cintNumberOfCustomers to process array because array //may be partially loaded. Count set in CS7Form_Load int cintNumberOfNames; private void CS7Form_Load(object sender, EventArgs e) { int i = 0; // subscript initialized to zero try { //Load the array with the data in the file FileStream nameFile = new FileStream("cs7.txt", FileMode.Open); StreamReader nameStreamReader = new StreamReader(nameFile); while (nameStreamReader.Peek() != -1) { if (i < cstrName.Length) { cstrName[i] = nameStreamReader.ReadLine();
  • 3. i += 1; //Increment subscript by one } else { MessageBox.Show ("Error: Notify Programmer Array Size Exceeded. ", "Array Size Exceeded", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; //Get of out of loop; Arrays are full. }//End If }//End Loop nameFile.Close(); //Close file } catch (Exception ex) { MessageBox.Show("Error Opening File. Data not loaded " + ex.Message, "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } cintNumberOfNames = i; //Save how many students were loaded displayNames(); //display names in list box } void displayNames() { int i; //Listboxes need to be cleared because this procedure is also //called to redisplayed the data lstName.Items.Clear(); //Use cintNumberOfnames to process a partially filled array //cintNumberOfnames is like Length, so we need to subtract one //to get the subscript value of the last entry. for (i = 0; i < cintNumberOfNames; i++) { lstName.Items.Add(cstrName[i]); }//next i - name }
  • 4. private void btnSortByName_Click(object sender, EventArgs e) { //Sort by name using a Simple Selection sort int i; int i2; string strHoldValue; string strMinName; int intMinSubscript; //outer loop keeps track of where the next value //should be placed. for (i = 0; i < cintNumberOfNames - 1; i++) { intMinSubscript = i; strMinName = cstrName[i]; //inner loop finds the lowest value to move up for (i2 = i + 1; i2 < cintNumberOfNames; i2++) { //Only == and != can be used with strings, use CompareTo if (cstrName[i2].CompareTo(strMinName) < 0) { //save the new low value found strMinName = cstrName[i2]; intMinSubscript = i2; } }//next i2 strHoldValue = cstrName[i]; cstrName[i] = cstrName[intMinSubscript]; cstrName[intMinSubscript] = strHoldValue; }//next i //display names in list box displayNames(); } private void btnSearchByName_Click(object sender, EventArgs e) { int i; bool blnNameFound = false;
  • 5. //array must be sorted ascending for early exit logic to work btnSortByName_Click(sender, e); for (i = 0; i < cintNumberOfNames; i++) { //case sensitive comparison if (txtSearchName.Text == cstrName[i]) { blnNameFound = true; txtSearchResults.Text = "Matching name is selected in list box."; lstName.SelectedIndex = i; break; //exit for loop } }//next i if (blnNameFound == false) { txtSearchResults.Text = "Match not found - Reached end of array"; } } private void btnDelete_Click(object sender, EventArgs e) { int i; int i2; for (i = 0; i < cintNumberOfNames; i++) { //move names up one posistion i2 = i + 1; cstrName[i] = cstrName[i2]; } //If the count is > 0 subtract one and redisplay names in list box if (cintNumberOfNames > 0) { //substract one from the count cintNumberOfNames -= 1; //display names in list box displayNames(); }
  • 6. } private void btnExit_Click(object sender, EventArgs e) { this.Close(); } }//end of class }//end of namespace Solution using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; //Project: CS7 Array Processing //Programmer: Daryl Austin //Description: Declare and load an array with a list of names. // The user can sort the list by name and search by name. // Names can be deleted from the top of the list. using System.IO; // FileStream and StreamReader namespace CS7 { public partial class CS7Form : Form { public CS7Form() { InitializeComponent();
  • 7. } //Declare class-level arrays //Array can hold up to 10 names. string[] cstrName = new string[9]; //Use cintNumberOfCustomers to process array because array //may be partially loaded. Count set in CS7Form_Load int cintNumberOfNames; private void CS7Form_Load(object sender, EventArgs e) { int i = 0; // subscript initialized to zero try { //Load the array with the data in the file FileStream nameFile = new FileStream("cs7.txt", FileMode.Open); StreamReader nameStreamReader = new StreamReader(nameFile); while (nameStreamReader.Peek() != -1) { if (i < cstrName.Length) { cstrName[i] = nameStreamReader.ReadLine(); i += 1; //Increment subscript by one } else { MessageBox.Show ("Error: Notify Programmer Array Size Exceeded. ", "Array Size Exceeded", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; //Get of out of loop; Arrays are full. }//End If }//End Loop
  • 8. nameFile.Close(); //Close file } catch (Exception ex) { MessageBox.Show("Error Opening File. Data not loaded " + ex.Message, "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } cintNumberOfNames = i; //Save how many students were loaded displayNames(); //display names in list box } void displayNames() { int i; //Listboxes need to be cleared because this procedure is also //called to redisplayed the data lstName.Items.Clear(); //Use cintNumberOfnames to process a partially filled array //cintNumberOfnames is like Length, so we need to subtract one //to get the subscript value of the last entry. for (i = 0; i < cintNumberOfNames; i++) { lstName.Items.Add(cstrName[i]); }//next i - name } private void btnSortByName_Click(object sender, EventArgs e) {
  • 9. //Sort by name using a Simple Selection sort int i; int i2; string strHoldValue; string strMinName; int intMinSubscript; //outer loop keeps track of where the next value //should be placed. for (i = 0; i < cintNumberOfNames - 1; i++) { intMinSubscript = i; strMinName = cstrName[i]; //inner loop finds the lowest value to move up for (i2 = i + 1; i2 < cintNumberOfNames; i2++) { //Only == and != can be used with strings, use CompareTo if (cstrName[i2].CompareTo(strMinName) < 0) { //save the new low value found strMinName = cstrName[i2]; intMinSubscript = i2; } } strHoldValue = cstrName[i]; cstrName[i] = cstrName[intMinSubscript]; cstrName[intMinSubscript] = strHoldValue; } //display names in list box displayNames(); }
  • 10. private void btnSearchByName_Click(object sender, EventArgs e) { int i; bool blnNameFound = false; //array must be sorted ascending for early exit logic to work btnSortByName_Click(sender, e); for (i = 0; i < cintNumberOfNames; i++) { //case sensitive comparison if (txtSearchName.Text == cstrName[i]) { blnNameFound = true; txtSearchResults.Text = "Matching name is selected in list box."; lstName.SelectedIndex = i; break; //exit for loop } }//next i if (blnNameFound == false) { txtSearchResults.Text = "Match not found - Reached end of array"; } } private void btnDelete_Click(object sender, EventArgs e) { int i; int i2; for (i = 0; i < cintNumberOfNames; i++) { //move names up one posistion
  • 11. i2 = i + 1; cstrName[i] = cstrName[i2]; } //If the count is > 0 subtract one and redisplay names in list box if (cintNumberOfNames > 0) { //substract one from the count cintNumberOfNames -= 1; //display names in list box displayNames(); } } private void btnExit_Click(object sender, EventArgs e) { this.Close(); } }//end of class }//end of namespace