![dianaosorio33895](/avatars/7441.jpg)
dianaosorio33895
07.04.2020 •
Computers and Technology
Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3
Solved
Show answers
More tips
- S Science and Technology Why is there no gravity on other planets?...
- F Food and Cooking Deflope: What is it and how does it work?...
- B Business and Finance How to Create a Business Plan? Your Ultimate Guide...
- F Food and Cooking Unusually Delicious Shashlik - Follow the Etiquette of Proper Preparation!...
- C Computers and Internet Make Easy Accessible Screenshots on iPad in Just a Few Minutes...
- T Travel and tourism Lost in the Catacombs: What to Do?...
- F Family and Home Protect Your Home or Apartment from Pesky Ants...
- H Health and Medicine How to Treat Styes: Causes, Symptoms, and Home Remedies...
- L Legal consultation What Documents Are Required for a Russian Passport?...
- F Family and Home How to Properly Use a Water Level?...
Answers on questions: Computers and Technology
- M Mathematics Lillian is trying to determine how people feel about the new act congress is trying to put through. which question would be the most appropriate for her survey? a) how do you feel...
- M Mathematics 6 pounds of potatoes cost $11.34. What is the unit price?...
- S Spanish I will mark you the brainlist Write a list in Spanish of your ten favorite hobbies/pastimes. 2. Make a collage of images representing these hobbies, and label them in Spanish....
- E English Read the excerpt from “a century ride.” the result of this confab was that auntie told two deliberate fibs, one to lizzie, and one to carr, and lizzie laughed happily and said,...
Ответ:
public class Match
{
public static void main(String[] args) {
final int NUM_VALS = 4;
int[] userValues = new int[NUM_VALS];
int matchValue, numMatches = 0;
userValues[0] = 2;
userValues[1] = 2;
userValues[2] = 1;
userValues[3] = 2;
matchValue = 2;
for(int i = 0; i < NUM_VALS; ++i) {
if(userValues[i] == matchValue)
numMatches++;
}
System.out.println("Match Value: " + matchValue + ", Number of Matches: " + numMatches);
}
Explanation:
- Initialize the userValues array with length of NUM_VALS, which is initialized as 4
- Assign the numbers to the userValues array
- Update matchValue as 2
- Initialize a for loop that iterates through userValues array. If a number that is equal to matchValue found in array, increase the numMatches by 1
- Print the matchValue and numMatches
Ответ:
(B) Every hazardous chemical that you may be exposed to at work
Explanation:
The communication standard of hazard is generally known as the "right to know" with regards to the united states working environment and network natural law.
It is the lawful rule in which the individual has the option to know the synthetics to which they might be uncovered in their day by day living. It is epitomized in government law in united states just as in nearby laws in a few states. This law provide the specific information that the every hazardous chemical are get exposed at the work.
Therefore, Option (B) is correct.