subject

Which of the following code segments is the correct solution for the following problem?

Find the first occurrence of the value "Joe" in the array strNames. Save the index of the element containing "Joe" in a variable named intPosition. Discontinue searching the array once the first occurrence of the element "Joe" has been located. Assume any variables you need are already defined.

A. blnFound = False
For intCount = 0 to strNames. Length -1 and Not blnFound
If strNames(intCount) = "Joe" Then
blnFound = True
intPosition = intCount
End If
Next

B. blnFound = True
intCount = 0
Do While (Not blnFound) And (intCount <= strNames. Length — 1)
If strNames(intCount) = "Joe" Then
blnFound = False
position = intCount
End If
intCount += 1
Loop

C. For intCount = 0 To strNames. length-1
If strNames(intCount) = "Joe" Then
intPosition = intCount
End If
Next

D. blnFound = False
intCount = 0
Do While (Not blnFound) And (intCount < strNames. Length)
If strNames(intCount) = "Joe" Then
blnFound = True
intPosition = intCount
End If
intCount += 1
Loop

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:20, SundaeSunday
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given. b)the definition of max_balance should be removed since header files should not contain constants. c)the definition of cashregister should be removed since header files should not contain class definitions. d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, wilkinsonei4069
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a, b] se pot scrie ca produs de două numere prime? “.
Answers: 1
image
Computers and Technology, 24.06.2019 23:30, clairajogriggsk
What is the opening page of a website called? a. web page b. landing page c. homepage d. opening page
Answers: 1
image
Computers and Technology, 25.06.2019 05:10, mathbrain58
Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_dict') as key-value pair. the program then asks if the user wants to enter more data (more data (y/n)? ) and depending on user choice, either asks for another name-number pair or exits and stores the dictionary key, values in a list of tuples and prints the list. note: ignore the case where the name is already in the dictionary. example: name: pranshu number: 517-244-2426 more data (y/n)? y name: rich number: 517-842-5425 more data (y/n)? y name: alireza number: 517-432-5224 more data (y/n)? n [('alireza', '517-432-5224'), ('pranshu', '517-244-2426'), ('rich', '517-842-5425')]
Answers: 3
You know the right answer?
Which of the following code segments is the correct solution for the following problem?

...

Questions in other subjects:

Konu
Mathematics, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Biology, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Mathematics, 18.09.2020 22:01
Konu
Biology, 18.09.2020 22:01