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
lions [1.4K]
3 years ago
12

What will the following code display? int numbers[4] = { 99, 87 }; cout << numbers[3] << endl; a. 87 b.0 d. 34. What

will the following code do? const int SIZE = 5; double x[SIZE]; for(int i = 2; i <= SIZE; i++) { x[i] = 0.0; } garbage This code will not compile a. Each element in the array is initialized to 0.0 b. Each element in the array, except the first, is initialized to 0.0 c. Each element in the array, except the first and the last, is initialized to 0.0 d. An error will occur when the code runs
Computers and Technology
1 answer:
pishuonlain [190]3 years ago
7 0

Answer:

1. The output is 0

2. Each element in the array is initialized to 0.0

Explanation:

Solving (a): The output of the code

We have:

<em>int numbers[4] = { 99, 87 }; </em>

<em>cout << numbers[3] << endl;</em>

<em />

The first line initializes the 0 and 1 index of the array to 99 and 87, respectively.

Other elements will be 0, by default.

So, the following code segment will output 0

<em>cout << numbers[3] << endl; </em>

<em />

Solving (b): What the given code will do?

The first and second line declares an array of 5 elements

However, the following iteration will only initialize the array with 0.0 starting from the second

<em>for(int i = 2; i <= SIZE; i++) { x[i] = 0.0; }</em>

<em />

Because, the counter is initialized to start from the second index.

You might be interested in
Module 7: Input and Output, 7-13d: Checkpoint
Oksi-84 [34.3K]

Answer:

F

Explanation:

6 0
4 years ago
There is an increasing need for private security personnel because of declining resources for many government agencies and a sho
aivan3 [116]
<span>True
</span><span>There is an increasing need for private security personnel because of declining resources for many government agencies and a shortage of police officers in many communities due to lack of funding.

</span>
8 0
4 years ago
A nonprofit organization uses a contact management database to track donations, amounts donated, and all correspondence and phon
notka56 [123]

Answer:

nvbvbnvvbnbnvbnvbn

Explanation:

vbnvbnvbnbnnnbvnn

7 0
3 years ago
The virus scanning technique that uses rules to determine if a program behaves like a virus is _________ scanning.
andrew-mc [135]

Answer:

Option c: Heuristic

Explanation:

Heuristic scanning is a form of computer virus detection analysis that screen for the suspicious characteristic of the program which maybe a virus. Heuristic scanning is designed to detect those new computer virus, unknown virus or the modified version of the known virus.

To perform heuristic scanning, a weigh-based evaluation algorithm will be adopted to estimate the likelihood of the current scanned program behaves like a virus which can pose a computer threat. If it exceeds a threshold level, an alarm will be triggered.

3 0
3 years ago
PLS HELP MEE!!!
kramer

Answer:

starting with lowercase letters, using uppercase letters for the first letter in a new word

Explanation:

starting with a dollar sign, using lowercase for the remaining parts of each word

4 0
3 years ago
Other questions:
  • There’s No Difference In Security If You Use A Public PC Or Your Own Computer.
    6·1 answer
  • Given that k refers to an int that is non-negative and that plist1 has been defined to be a list with at least k 1 elements, wri
    14·1 answer
  • Select all that apply.
    9·1 answer
  • What are the two main objectives associated with data mining? uncovering competitors and market advantages uncovering tactics an
    15·1 answer
  • In this chapter, you saw an example of how to write an algorithm that determines whether a number is even or odd. Write a progra
    6·2 answers
  • What is a text based language that can be used to build all kinds of things ????
    9·1 answer
  • Write a recursive function is_pow2(n) that returns True if the positive integer n is an integer power of 2, and False otherwise.
    9·1 answer
  • Consider the code block below. What is the value of amount when this method is called twice, the first time using cookieJar(7) a
    14·1 answer
  • A file named loan.html, write an HTML document that looks similar to figure 9-7 in the textbook. Write four functions with these
    8·1 answer
  • You're asked to recommend potential data structures to use as the backing for implementing Kruskal's algorithm. Which of the fol
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!