Q16. Which of the following codes is correct for "Find CGPA" button to search for a CGPA of students?
Formt
id
Name
CGPA
Enter Name: Sara
1
James
2.45
2
Sara
3.45
Find COPA
3
Daniel
2.36
Found, The COPS is: 3.45
a. private void FindCGPA_Click(object sender, EventArgs e) {
int i;
for (i = 0; i < listView1.Size; i++)
if (listView1.Items[i].Text == textBox.Text) label.Text = "Found, The CGPS is: "+listView1.items[i].Text; }
b. private void FindCGPA_Click(object sender, EventArgs e) {
int i;
for (i = 0; i < listView1.items.Count; i++)
if (listView1.items[i].Subitems[1].Text == textBox.Text)
label.Text = "Found, The CGPS is: "+listView1.items[i].Subitems[2].Text; }
CMPE214 Final
c. private void FindCGPA_Click(object sender, EventArgs e) {
int i
while (i<listView1.Count) {
if (listView1.items[i] = textBox.Text)
label. Text "Found The CGPS sistViewL.Text;
d. private void FindCGPA_Click(object sender, EventArgs e) {
int i;
for (i=0; i<listView1.length; i++)
if (listView1.items[i].Text textBox.Text) label.Text "Found, The CGPS is: "+listView1.items[i].Text;
iven the below.cum