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
Alik [6]
3 years ago
15

Create the content for your website.

Computers and Technology
1 answer:
arlik [135]3 years ago
5 0
What do you need help with? I’m confused
You might be interested in
Given an array as follows
slava [35]

Answer:

1) Method calcTotal:

  1. public static long calcTotal(long [][] arr2D){
  2.        long total = 0;
  3.        
  4.        for(int i = 0; i < arr2D.length; i++ )
  5.        {
  6.            for(int j = 0; j < arr2D[i].length; j++)
  7.            {
  8.                total = total + arr2D[i][j];
  9.            }
  10.        }
  11.        
  12.        return total;
  13.    }

Explanation:

Line 1: Define a public method <em>calcTotal</em> and this method accept a two-dimensional array

Line 2: Declare a variable, total, and initialize it with zero.

Line 4: An outer for-loop to iterate through every rows of the two-dimensional array

Line 6: An inner  for-loop to iterate though every columns within a particular row.

Line 8: Within the inner for-loop, use current row and column index, i and j, to repeatedly extract the value of each element in the array and add it to the variable total.

Line 12: Return the final total of all the element values as an output

Answer:

2) Method calcAverage:

  1. public static double calcAverage(long [][] arr2D){
  2.        double total = 0;
  3.        int count = 0;
  4.        
  5.        for(int i = 0; i < arr2D.length; i++ )
  6.        {
  7.            for(int j = 0; j < arr2D[i].length; j++)
  8.            {
  9.                total = total + arr2D[i][j];
  10.                count++;
  11.            }
  12.            
  13.        }
  14.        
  15.        double average = total / count;
  16.        
  17.        return average;
  18.    }

Explanation:

The code in method <em>calcAverage</em> is quite similar to method <em>calcTotal</em>. We just need to add a counter and use that counter as a divisor of total values to obtain an average.

Line 4: Declare a variable, count, as an counter and initialize it to zero.

Line 11: Whenever an element of the 2D array is added to the total, the count is incremented by one. By doing so, we can get the total number of elements that exist in the array.

Line 16: Use the count as a divisor to the total to get average

Line 18: Return the average of all the values in the array as an output.

Answer:

3) calcRowAverage:

  1. public static double calcRowAverage(long [][] arr2D, int row){
  2.        double total = 0;
  3.        int count = 0;
  4.        
  5.        for(int i = 0; i < arr2D.length; i++ )
  6.        {
  7.            if(i == row)
  8.            {
  9.                for(int j = 0; j < arr2D[i].length; j++)
  10.                {
  11.                    total = total + arr2D[i][j];
  12.                    count++;
  13.                }
  14.            }
  15.            
  16.        }
  17.        
  18.        double average = total / count;
  19.        
  20.        return average;
  21.    }

Explanation:

By using method <em>calcAverage </em>as a foundation, add one more parameter, row, in the method <em>calcRowAverage</em>. The row number is used as an conditional checking criteria to ensure only that particular row of elements will be summed up and divided by the counter to get an average of that row.

Line 1: Add one more parameter, row,

Line 8-15: Check if current row index, i, is equal to the target row number, proceed to sum up the array element in that particular row and increment the counter.

5 0
3 years ago
Assume a disk cache hit rate (dchr) of 95% and 2 millisecond on average to access a page in cache. If the average access time to
MrRa [10]

Answer:

The answer is provided in the form of explanation

Explanation:

A page fault occurs means that the required page is not in main memory. First OS check for

page in the cache memory, if the page is present then retrieved but if not present then check for

page in main memory and if the page is not present here too then it searches for page in hard

drive. To calculate the expected time, the following formula is used:

Cache hit ratio = 95% = 0.95

Cache miss ratio = 5% = 0.05

Cache access time = 2 millisecond

The average access time of hard drive = 30 milliseconds

Expected time = Hit ratio (cache access time +memory access time) + Miss ratio (cache

access time + 2 * memory access time)

= 0.95 (2+30) + 0.05 (2+2*30)

= 0.95 (32) + 0.05(62)

=30.4 + 3.1

= 33.5 millisecond

Expected time = cache hit ratio * cache access time + (1 – hit ratio) * cache miss ratio

= 0.95*2+(1-0.95)*0.05

= 1.9025

4 0
3 years ago
Or operator of boolean algebra is denoted by:<br>*<br>+<br>-<br>.​
OlgaM077 [116]

Answer:

or operator is denoted by + sign

7 0
3 years ago
What app/software is this? (edit vids)​
Yuki888 [10]
I think that is Filmora?
5 0
3 years ago
What are three examples of information technologies you use in your everyday life? Which do you consider to be the most importan
Anit [1.1K]
I think there's so many example of information technology in our daily life.

The word information and technology which means all of information that is provided by technology.

Every day we use information technology such as social media, television, computer, and etc.

I think this brainly platform is also information technology.

Which can provide so much necessary information to the whole world
3 0
3 years ago
Other questions:
  • Design a Visual Logic flowchart for a program that prompts the user to enter ten numbers one at a time. After the user has enter
    10·1 answer
  • What is the purpose of interrupts? What is a trap? Can traps be generated intentionally by a user program? If so, for what purpo
    13·1 answer
  • &gt;&gt;&gt; import math &gt;&gt;&gt; print(math.Pi) 3.141592653589793 &gt;&gt;&gt; def print_volume(): print ("What is the radi
    12·1 answer
  • Text documents images audio clips and software applications are all examples of blank that are stored in files
    8·2 answers
  • Write the definition of a function named isSorted that receives three arguments: an array of int , an int that indicates the num
    11·1 answer
  • Which examples are relevant sources for students to use in research?
    6·1 answer
  • Which characteristic of a relational database distinguishes it from a flat file?
    5·1 answer
  • Critical Thinking Questions
    15·2 answers
  • Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
    15·2 answers
  • Match the definitions to their respective cli hot keys and shortcuts. (not all options are used.)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!