Answer:
import java.util.Scanner;
public class FindMatchValue {
public static void main (String [] args) {
final int NUM_VALS = 4;
int[] userValues = new int[NUM_VALS];
int i = 0;
int matchValue = 0;
int numMatches = -99; // Assign numMatches with 0 before your for loop
userValues[0] = 2;
userValues[1] = 2;
userValues[2] = 1;
userValues[3] = 2;
matchValue = 2;
numMatches=0;
for(i=0;i<NUM_VALS;i++)
{
if(userValues[i]==matchValue)//cheking if the array element is equal to match value.
{
numMatches++;
}
}
System.out.println(numMatches);//printing the matchvalue.
}
}
Output:-
3
Explanation:
First I have set the value numMatches to 0 before the loop.Then I have user the for loop to iterate over the array.In the for loop I am checking that the array element is equal to the matchValue or not if it is equal then increasing the numMatches by 1.Then at last print the value of numMatches.
A field whose data type is URL address data can store text that can be used as a hyperlink address.
Answer:
public: virtual void print()=0;
Explanation:
An abstract class contains a pure virtual function. Pure virtual class cannot be instantiated but it can be subclassed and the subclass can provide an implementation of the function.
A virtual function declaration in the class is preceded by the virtual keyword. For example, virtual void print();
A pure virtual function declaration is followed by '=0;'
public: virtual void print()=0;
When drilling, students in a study session use flashcards to quiz one another. thus, Option B is the correct statement.
<h3>
What do you mean by drill and practice?</h3>
The term drill and practice can be described as a way of practice characterized by systematic repetition of concepts, examples, and exercise problems.
Drill and exercise is a disciplined and repetitious exercise, used as an average of coaching and perfecting an ability or procedure.
Thus, When drilling, students in a study session use flashcards to quiz one another. Option B is the correct statement.
Learn more about drill and practice:
brainly.com/question/27587324
#SPJ1