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
denis-greek [22]
4 years ago
10

How would you describe by adding comments to the coding explaining that you know what int num1 = 10; int ave = (num1+num2+num3)/

3; means? Is it declaring that num1 = 10?
Computers and Technology
1 answer:
Radda [10]4 years ago
8 0

Answer:

//declaring variable num1 and intializing it to 10

int num1 = 10;

//declaring variable ave and assigning average of 3 numbers num1,num2,num3

int ave = (num1+num2+num3)/3;

Explanation:

//declaring variable num1 and intializing it to 10

int num1 = 10;

//declaring variable ave and assigning average of 3 numbers num1,num2,num3

int ave = (num1+num2+num3)/3;

You might be interested in
What aspect of web design is Gloria following when she uses the same color
tresset_1 [31]
The answer to this is C
4 0
3 years ago
Read 2 more answers
What is the purpose of a project overview?
andreyandreev [35.5K]

Answer:

option 3 should be the answer is this helps please give the brainliest award.

7 0
3 years ago
Read 2 more answers
If you have a long title for a table and need it to span several cells you use
dsp73
If you are talking about on Microsoft Excel then you merge the cells.
6 0
3 years ago
1)
spayn [35]

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.

4 0
4 years ago
A listing of all the methods that are in the execution chain when an exception is thrown is called a(n) ____.
wolverine [178]

A(n) stack trace is a list of all the steps that make up the performance chain when an exception is thrown.

<h3>What exactly is a stack trace?</h3>
  • A stack trace is a report of the active stack frames at a specific point in the execution of a program in computing (also known as a stack backtrace or stack traceback).
  • Memory is frequently dynamically allocated in two locations during program execution: the stack and the heap.
  • As implied by their names, memory is continually allocated on a stack but not on a heap.
  • This stack is known as the program's function call stack in order to distinguish it from the programming construct stack, which is another term for stack.
  • In terms of technology, after a memory block has been assigned

To learn more about stack trace, refer to:

brainly.com/question/15886149

#SPJ4

4 0
2 years ago
Other questions:
  • What does a computer user need to know about programming in order to play a video game?
    6·2 answers
  • For security reasons a network administrator needs to ensure that local computers cannot ping each other. which settings can acc
    5·1 answer
  • What is the symbol for the relational operator 'equal to'?
    8·1 answer
  • Which scenario could be represented by the given graph?
    14·1 answer
  • Write a program to read a record from a binary file
    8·1 answer
  • The arguments in a method call are often referred to as ____ . The variables in the method declaration that accept the values fr
    10·1 answer
  • which of the following is something that an information systems (IS) professional would do? A. devise new ways to use computers
    10·1 answer
  • What adaptation Judy and her parents have that help them run from predators coming?​
    6·1 answer
  • During slide show mode, hitting the B key will do which of these things? end your presentation move back one page move to the fi
    15·1 answer
  • You recently discovered that several key files of your antivirus program have been deleted. you suspect that a virus has deleted
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!