1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SVEN [57.7K]
4 years ago
14

1)

Computers and Technology
1 answer:
spayn [35]4 years ago
4 0

Answer:

1)

for(i = 0; i < NUM_VALS; ++i) {

  if(userValues[i] == matchValue) {

     numMatches++;  }    }

2)  

for (i = 0; i < NUM_GUESSES; i++) {

      scanf("%d", &userGuesses[i]);   }

  for (i = 0; i < NUM_GUESSES; ++i) {

         printf("%d ", userGuesses[i]);    }

3)

sumExtra = 0;

for (i = 0; i < NUM_VALS; ++i){

     if (testGrades[i] > 100){  

        sumExtra = testGrades[i] - 100 + sumExtra;    }       }

4)

for (i = 0; i < NUM_VALS; ++i) {

    if (i<(NUM_VALS-1))  

   printf( "%d,", hourlyTemp[i]);

    else  

    printf("%d",hourlyTemp[i]); }      

Explanation:

1) This loop works as follows:

1st iteration:

i = 0

As i= 0 and NUM_VALS = 4 This means for condition i<NUM_VALS  is true so the body of loop executes

if(userValues[i] == matchValue) condition checks if element at i-th index position of userValues[] array is equal to the value of matchValue variable. As matchValue = 2 and i = 0 So the statement becomes:

userValues[0] == 2

2 == 2

As the value at 0th index (1st element) of userValues is 2 so the above condition is true and the value of numMatches is incremented to 1. So numMatches = 1

Now value of i is incremented to 1 so i=1

2nd iteration:

i = 1

As i= 1 and NUM_VALS = 4 This means for condition i<NUM_VALS  is true so the body of loop executes

if(userValues[i] == matchValue) condition checks if element at i-th index position of userValues[] array is equal to the value of matchValue variable. As matchValue = 2 and i = 1 So the statement becomes:

userValues[1] == 2

2 == 2

As the value at 1st index (2nd element) of userValues is 2 so the above condition is true and the value of numMatches is incremented to 1. So numMatches = 2

Now value of i is incremented to 1 so i=2

The same procedure continues at each iteration.

The last iteration is shown below:

5th iteration:

i = 4

As i= 4 and NUM_VALS = 4 This means for condition i<NUM_VALS  is false so the loop breaks

Next the statement: printf("matchValue: %d, numMatches: %d\n", matchValue, numMatches);  executes which displays the value of

numMatches = 3

2)

The first loop works as follows:

At first iteration:

i = 0

i<NUM_GUESSES is true as NUM_GUESSES = 3 and i= 0 so 0<3

So the body of loop executes which reads the element at ith index (0-th) index i.e. 1st element of userGuesses array. Then value of i is incremented to i and i = 1.

At each iteration each element at i-th index is read using scanf such as element at userGuesses[0], userGuesses[1], userGuesses[2]. The loop stops at i=4 as i<NUM_GUESSES evaluates to false.

The second loop works as follows:

At first iteration:

i = 0

i<NUM_GUESSES is true as NUM_GUESSES = 3 and i= 0 so 0<3

So the body of loop executes which prints the element at ith index (0-th) index i.e. 1st element of userGuesses array. Then value of i is incremented to i and i = 1.

At each iteration, each element at i-th index is printed on output screen using printf such as element at userGuesses[0], userGuesses[1], userGuesses[2] is displayed. The loop stops at i=4 as i<NUM_GUESSES evaluates to false.

So if user enters enters 9 5 2, then the output is 9 5 2

3)

The loop works as follows:

At first iteration:

i=0

i<NUM_VALS is true as NUM_VALS = 4 so 0<4. Hence the loop body executes.

if (testGrades[i] > 100 checks if the element at i-th index of testGrades array is greater than 100. As i=0 so this statement becomes:

if (testGrades[0] > 100

As testGrades[0] = 101 so this condition evaluates to true as 101>100

So the statement sumExtra = testGrades[i] - 100 + sumExtra; executes which becomes:

sumExtra = testGrades[0] - 100 + sumExtra

As sumExtra = 0

testGrades[0] = 101

So

sumExtra = 101 - 100 + 0

sumExtra = 1

The same procedure is done at each iteration until the loop breaks. The output is:

sumExtra = 8

4)

The loop works as follows:

At first iteration

i=0

i < NUM_VALS is true as  NUM_VALS = 4 so 0<4 Hence loop body executes.

if (i<(NUM_VALS-1))   checks if i is less than NUM_VALS-1 which is 4-1=3

It is also true as 0<3 Hence the statement in body of i executes

printf( "%d,", hourlyTemp[i]) statement prints the element at i-th index i.e. at 0-th index of hourlyTemp array with a comma (,) in the end. As hourlyTemp[0] = 90; So 90, is printed.

When the above IF condition evaluates to false i.e. when i = 3 then else part executes which prints the hourlyTemp[3] = 95 without comma.

Same procedure happens at each iteration unless value of i exceeds NUM_VAL.

The output is:

90, 92, 94, 95

The programs along with their output are attached.

You might be interested in
Write. A program to fine the difference of two number 25 and 17 . Also displays the output
Anon25 [30]

Answer:

Answer = 25-17

print("25-17", Answer)

Explanation:

You put the sum into a variable which in this case would be Answer and then you can output it with the question.

6 0
3 years ago
Help me with this…… please
Brums [2.3K]

Answer:

2. The texture is being use to look sturdy

3. some repetition are being repeated for example the blocks

4. No it because of the words

5. The words at the bottom

It my opinion so it might not be correct

8 0
2 years ago
A network administrator enters the command ipv6 router ospf 110 in global configuration mode. What is the result of this command
Zepler [3.9K]

Answer:

The OSPFv3 AS number will be assigned an ID of 110

Explanation:

If we don't have ipv4 addressing previously, we are going to assign the router-id manually.

We are going to receive a message about the assignation manually.

We can assign a router-id with the next line:

#router-id 1.1.1.1

If we already have the ipv4 addressing, the router going to assign the router-id automatically.

4 0
3 years ago
You are asked to assume the role of an employee of the DigiFirm Investigation Company. As part of its community outreach effort,
kirill [66]

Answer:

1.  To trace an email we need to examine the header part of the email. By examine the header of an email we could extract the sender, subject and other important credentials related to that email.  

2. The command to trace the email id is “whois” command.

 First open the email client and find the IP address of the received email that need to be traced.  The command “whois” IP address gives the registration information of that IP address.

 3.  Reverse address/email search is the procedure used by the experts to find the origin or the ownership of the email.  Rather than tools websites are more use full in the reverse address search.

http://reverse.addresssearch.com, www.iplocation.net, etc. are good to find the ownership of an email.

4. We need to set up mail server to send, receive and to explore various activities associated with an email.  The other related purpose servers like SMTP server, HTTP server , etc are also required to assist large organizations.  The mail server can be a stand-alone computer or a collection of computer and servers.

 5.  The executable files should be examined thoroughly in the server, it can be dangerous malwares.  The examination is mainly done by scanning for malicious words and sender address.  Since many mail providers does not allow executable files to send, so the attackers are using other files also as a carrier of the malwares, so now every emails should be subject to deep examination using some malware scanner.  

6.   By the time of examination the some of the legitimate mails may also come under the suspect list so further check is needed there.  At the same time the attacks can be from legitimate sources also this could be go un-noticed; this should be also a challenge to face in the stage of e-mail examination.

8 0
3 years ago
Ursa Major Solar wants to automatically notify a manager about any cases awaiting a response from an agent for more than 2 hours
weqwewe [10]

The feature that the administrator has to use to fulfill this requirement is a  Case Escalation Rule.

The answer to this question is option A.

<h3>What is a case escalation rule?</h3>

This is what is used to reroute a case. It has the ability of passing notifications to a user after a given length of time has gone by.

With this rule the person would be able to make the choice is the case is to be escalated or if it should be passed to a different user.

Read more on the Case Escalation Rule here:

brainly.com/question/14161284?referrer=searchResults

An escalation rule automatically reroutes a case and can notify a user if the case remains open after a certain period of time has passed. With an escalation rule, you can: Choose to escalate a case to a queue or to another user.

3 0
2 years ago
Other questions:
  • Suppose you want to click up- and down-arrows on a "control" to change the value of the product price in cell C7. What form cont
    10·1 answer
  • A(n) _________ website contains factual information, such as libraries, encyclopedias, dictionaries, guides, and other types of
    8·1 answer
  • Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item
    9·1 answer
  • Electronic cover letters are longer than traditional paper cover letters.
    13·2 answers
  • pharmaceutical company is using blockchain to manage their supply chain. Some of their drugs must be stored at a lower temperatu
    5·2 answers
  • What kind of waste does a computer generate?<br><br> Will give brainly :3
    12·1 answer
  • One vulnerability that makes computers susceptible to walmare is:
    13·2 answers
  • Most computers include a network card designed to connect a computer to the net using standard telephone service. True or False?
    11·1 answer
  • 1 Which one of the following is a transmission
    9·1 answer
  • Computer are most wonderful creation of 21st century how ?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!