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
11Alexandr11 [23.1K]
3 years ago
12

Input numbers and segregate them by placing their values into even or odd vectors based upon their value being even or odd. Then

fill a 2-D array with the first column containing the contents of the even vector and the second column containing the odd vector. Output the result and display the contents of the vectors and array.
Computers and Technology
1 answer:
dedylja [7]3 years ago
7 0

Answer:

The solution code is written in Python

  1. input_numbers = [5, 7, 1, 12, 9, 34, 22, 97, 112]
  2. evenVec = []
  3. oddVec = []
  4. for x in input_numbers:
  5.    if x % 2 == 0:
  6.        evenVec.append(x)
  7.    else:
  8.        oddVec.append(x)
  9. num2D = [evenVec, oddVec]
  10. print(num2D)

Explanation:

Let's create a sample input numbers that mixed with odd and even values (Line 1)

Next, create evenVec and oddVec variables to hold the even and odd numbers from the input_numbers (Line 3 - 4).

Create a for-loop to traverse through the input_numbers and check if current number, x, is divisible by 2 using the modulus operator %. If so, x % 2 will be evaluated to 0 and append the current x to evenVec or else append to oddVec (Line 6 - 10).

Next, create a variable num2D to hold the two dimensional arrays with first column is evenVec and second column is oddVec (Line 12).

When printing the num2D (Line 14), we shall get

[[12, 34, 22, 112], [5, 7, 1, 9, 97]]

You might be interested in
Keyshia wants to add movement to her PowerPoint presentation. Which tab should she use to complete this task?
MariettaO [177]

Answer:

A on edg

Explanation:

5 0
3 years ago
​In terms of e-commerce infrastructure, the Web server's required amount of storage capacity and computing power depends primari
Tamiku [17]

Answer:

Option A is correct

Explanation:

The computing power of a web server and the storage capacity mostly depend on the software that run the server and the volume of e-commerce transactions.

8 0
4 years ago
Read 2 more answers
What is number system​
schepotkina [342]

<u>★ Defination:</u>

The number system or the numeral system is the system of naming or representing numbers. The number system helps to represent numbers in a small symbol set.

<u>★ Tips:</u>

The value of any digit in a number can be determined by:

• The digit

• Its position in the number

• The base of the number system

<u>★ Types of number system:</u>

There are various types of number system in mathematics. The four most common number system types are:

• Decimal number system (Base- 10)

• Binary number system (Base- 2)

• Octal number system (Base-8)

• Hexadecimal number system (Base- 16)

8 0
3 years ago
When an organization uses cloud computing, they do not have to buy and maintain expensive hardware. Group of answer choices True
pshichka [43]

Answer:

The answer is "False".

Explanation:

Cloud computing refers to files and services, that are processed to retrieved over all the computers, rather than on the hard disk of your machine. It's also known as a Net metaphor, which is a so-called local disc and device, whenever you store information on a disc or run programs.

  • It uses distributed tools to save software and other equipment costs in organizations.  
  • It is a pay structure of "utility", that uses expensive hardware, and maintains it, that's why the given statement is false.

4 0
3 years ago
What concept or principle requires layered, complementary controls sufficient to detect and deter infiltration and exploitation
Alekssandra [29.7K]

Answer:

security In-depth

Explanation:

The security in depth is a principle in which a sequence of safeguarding channels is used to secure the important data and information i.e valuation to the company. It also increased the security for a company as a whole

Therefore in the given situation, the  security In-depth required to layered the safeguarding channels to detect the infiltration

Hence, the  security In-depth is the correct answer

4 0
4 years ago
Other questions:
  • Which activity constitutes legal computer activity?
    12·1 answer
  • If you find yourself in a position where you need to restore an object or container within active directory that has been inadve
    6·1 answer
  • John, the network administrator of XYZ Corporation, is interested in changing the format of text from the American Standard Code
    10·1 answer
  • âthe first line in a hypertext markup language (html) file is the _____, which is a processing instruction indicating the markup
    9·2 answers
  • A(n) ______________________________ is a camera mount that uses the concept of a lever and fulcrum and allows a camera to be rai
    9·1 answer
  • you crossed two heterozygous red flowers (dominant color), what are your chances to have a white flower
    11·1 answer
  • Convert the following denary numbers into binary using 8-bit register:
    6·1 answer
  • What is the last usable host IP address on the 192.168.32.9/30 network?
    15·1 answer
  • If there is an int/integer in a array, and the same int/integer comes at the same spot, does it cancel each other out or does it
    14·1 answer
  • Who used the ICT in a report to UK government in 1997
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!