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
gregori [183]
2 years ago
5

Consider the following code segment.

Computers and Technology
1 answer:
antiseptic1488 [7]2 years ago
6 0

Answer:

C. "Condition one" is printed once, and "Condition two" is printed twice.

Explanation:

Given

The above code segment

Required

The number of times each\ print\ statement is executed

For "Condition one" to be printed, the following conditions must be true:

if (col > 0) ---- the column must be greater than 0 i.e. column 1 and 2

if (arr[row][col] >= arr[row][col - 1]) --- the current element must be greater than the element in the previous column

Through the iteration of the array, the condition is met just once. When

row = 1  and   col = 2

arr[1][2] > arr[1][2-1]

arr[1][2] > arr[1][1]

4 > 3

For "Condition two" to be printed, the following condition must be true:

if (arr[row][col] % 2 == 0) ----array element must be even

Through the iteration of the array, the condition is met twice. When

row = 0  and   col = 1

row = 1  and   col = 0

arr[0][1] = 2

arr[1][0] = 4

You might be interested in
The movie polar express was critically acclaimed due to the unbelievably lifelike movements of Tom Hanks character
Fed [463]
I think it is greyhound
6 0
2 years ago
Which building-block feature is available in the Text grouping on the Insert tab?
saveliy_v [14]

Answer:

Business information

Explanation:

The building blocks are durable objects for content like corporate material, headings, timetables, and gallery advertising. The user can retrieve and utilize the building blocks at any time. The user can also design, saves, categorize and enter a description of their own building blocks, and tag them with keywords to help them find easily. 

Business information is one of the main features of the building block galleries that is found on the insert tab in text group.

3 0
3 years ago
Write an efficient C++ function that takes any integer value i and returns 2^i ,as a long value. Your function should not multip
Ilya [14]

Answer:

long power(int i)

{

   return pow(2,i);

}

Explanation:

The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.

for ex:-

pow(3,2);

It means 3^2 and it will return 9.

4 0
3 years ago
ROE: what does this represent (in plain terms)? In what range would this number typically be? What type of person/position would
LuckyWell [14K]

Answer:

<em>The ROE in plain terms is called  the return on equity (ROE) is a measure of inflow of profit in business in relation to the equity, also known as assets net worth  or assets of liabilities  ROE is a method  of how l  company generate earnings through investment </em>

Explanation:

<em>The ROE in plain terms is called  the return on equity (ROE) is a measure of inflow of profit in business in relation to the equity, also known as assets net worth  or assets of liabilities  ROE is a method  of how l  company generate earnings through investment </em>

<em>The ROE range number can be of any value or percentage example 15% upwards</em>

<em>The type of person or position with roles to play are usually a professional, such as an accountant, bookkeeper, or payroll processor, who completes ROEs on behalf of your clients in the organisation.</em>

4 0
3 years ago
2. Consider a 2 GHz processor where two important programs, A and B, take one second each to execute. Each program has a CPI of
allsm [11]

Answer:

program A runs in 1 sec in the original processor and 0.88 sec in the new processor.

So, the new processor out-perform the original processor on program A.

Program B runs in 1 sec in the original processor and 1.12 sec in the new processor.

So, the original processor is better then the new processor for program B.

Explanation:

Finding number of instructions in A and B using time taken by the original processor :

The clock speed of the original processor is 2 GHz.

which means each clock takes, 1/clockspeed

= 1 / 2GH = 0.5ns

Now, the CPI for this processor is 1.5 for both programs A and B. therefore each instruction takes 1.5 clock cycles.

Let's say there are n instructions in each program.

therefore time taken to execute n instructions

= n * CPI * cycletime = n * 1.5 * 0.5ns

from the question, each program takes 1 sec to execute in the original processor.

therefore

n * 1.5 * 0.5ns = 1sec

n = 1.3333 * 10^9

So, number of instructions in each program is 1.3333 * 10^9

the new processor :

The cycle time for the new processor is 0.6 ns.

Time taken by program A = time taken to execute n instructions

=  n * CPI * cycletime

= 1.3333 * 10^9 * 1.1 * 0.6ns

= 0.88 sec

Time taken by program B = time taken to execute n instructions

= n * CPI * cycletime

= 1.3333 * 10^9 * 1.4 * 0.6

= 1.12 sec

Now, program A runs in 1 sec in the original processor and 0.88 sec in the new processor.

So, the new processor out-perform the original processor on program A.

Program B runs in 1 sec in the original processor and 1.12 sec in the new processor.

So, the original processor is better then the new processor for program B.

5 0
2 years ago
Other questions:
  • 5. What would the browser display if the following code were executed in a script?a var product = 0; while ( product &lt;= 25 );
    8·1 answer
  • There are many differenttypes of models, but an individual DSS can consist of onlyone.
    15·1 answer
  • A disadvantage of creating a website with tables, without CSS is
    15·2 answers
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. I have 3 other HTML pages that have t
    12·1 answer
  • Python provides a special version of a decision structure known as the ________ statement, which makes the logic of the nested d
    13·1 answer
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • Lexi wants to buy a $300 painting. when she gets to the store, she finds that it is on sale for 40% off. how much does Lexi spen
    10·1 answer
  • One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input
    12·1 answer
  • Why are default parameters useful? *This is JavaScript*
    7·1 answer
  • What does the following loop do? val = 0 total = 0 while (val &lt; 10): val = val + 1 total = total + val print(total)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!