answer.
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
ArbitrLikvidat [17]
2 years ago
8

Write a static method named countLastDigits that accepts an array of integers as a parameter and examines its elements to determ

ine how many end in 0, how many end in 1, how many end in 2 and so on. Your method will return an array of counters. The count of how many elements end in 0 should be stored in its element at index 0, how many of the values end in 1 should be stored in its element at index 1, and so on.
Computers and Technology
1 answer:
Crazy boy [7]2 years ago
8 0

Answer:

See explaination for the program code

Explanation:

code:

public static int[] countLastDigits(int[] list) {

int[] count = new int[10];

for (int i = 0; i < list.length; i++) {

int digit = list[i] % 10;

count[digit]++;

}

return count;

}

You might be interested in
Which two functions are provided to users by the context-sensitive help feature of the Cisco IOS CLI? (Choose two.)
Svetach [21]

Answer:

B. displaying a list of all available commands within the current mode*

D. determining which option, keyword, or argument is available for the entered command*

Explanation:

Cisco IOS are known for using Command line interface(CLI) that allows execution of certain commands

Cisco system make use devices such as router, switch and others. All these Commans comes with privileged levels that gives access to user that have privilege to access between level 0 and 15.

It should be noted that two functions that are provided to users by the context-sensitive help feature of the Cisco IOS CLI are ;

✓displaying a list of all available commands within the current mode

✓ determining which option, keyword, or argument is available for the

5 0
2 years ago
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
1 year ago
Read 2 more answers
A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
victus00 [196]

Answer:

The minimum number of bits necessary to address 8K words is 13.

Explanation:

You have the number of words to address that is 8000 words, a word is the smallest addressable memory unit.  

8000 words can be addressed with 2^{n}  units. Now you have to find the value of n that approximates to the number of words.  

2^2=4\\2^4=16\\2^7=128\\2^{10}=1024\\2^{12}=4096\\2^{13}=8192

So you can see that 13 bits are needed to address 8K words.

7 0
1 year ago
Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than m
Sever21 [200]

Answer:

The solution is written using Python as it has a simple syntax.

  1. def getHighScores(gameScores, minScore):
  2.    meetsThreshold = []
  3.    for score in gameScores:
  4.        if(score > minScore):
  5.            meetsThreshold.append(score)
  6.    return meetsThreshold
  7. gameScores = [2, 5, 7, 6, 1, 9, 1]
  8. minScore = 5
  9. highScores = getHighScores(gameScores, minScore)
  10. print(highScores)

Explanation:

Line 1-8

  • Create a function and name it as <em>getHighScores</em> which accepts two values, <em>gameScores</em> and <em>minScore</em>. (Line 1)
  • Create an empty list/array and assign it to variable <em>meetsThreshold</em>. (Line 2)
  • Create a for loop to iterate through each of the score in the <em>gameScores</em> (Line 4)
  • Set a condition if the current score is bigger than the <em>minScore</em>, add the score into the <em>meetsThreshold</em> list (Line 5-6)
  • Return <em>meetsThreshold</em> list as the output

Line 11-12

  • create a random list of <em>gameScores</em> (Line 11)
  • Set the minimum score to 5 (Line 12)

Line 13-14

  • Call the function <em>getHighScores()</em> and pass the<em> gameScores</em> and <em>minScore </em>as the arguments. The codes within the function <em>getHighScores()</em>  will run and return the <em>meetsThreshold </em>list and assign it to <em>highScores.</em> (Line 13)
  • Display <em>highScores</em> using built-in function print().
8 0
1 year ago
An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
Yakvenalex [24]

Answer:

See explanation

Explanation:

My explanation to the author is that:

The reduction in size of the attachment doesn't mean that some parts of the book (i.e. the attachment) has been deleted.

I'll also made him understand that the book will retain its original size and contents after downloading by the recipient of the mail.

6 0
2 years ago
Other questions:
  • The Paste Options button labeled ____ is used if you want the pasted chart not to be linked to the source document but you want
    9·1 answer
  • What three requirements are defined by the protocols used in network communications to allow message transmission across a netwo
    11·1 answer
  • Write the definition of a function named averager that receives a double parameter and return-- as a double -- the average value
    12·1 answer
  • Suppose that each row of an n×n array A consists of 1’s and 0’s such that, in any row i of A, all the 1’s come before any 0’s in
    15·1 answer
  • 12) Suppose you wanted a subroutine to return to an address that was 3 bytes higher in memory than the return address currently
    11·1 answer
  • The user interface contains two types of user input controls: TextInput, which accepts all characters and Numeric Input, which a
    11·1 answer
  • In cell M2, enter a formula using a nested IF function as follows to determine first if a student has already been elected to of
    12·1 answer
  • Write a SELECT statement that selects all of the columns for the catalog view that returns information about foreign keys. How m
    6·1 answer
  • Chinh wants to have a program print, "Sorry, but that isn’t one of your options" until the user enters the correct information.
    13·1 answer
  • In this problem, you will derive the efficiency of a CSMA/CD-like multiple access protocol. In this protocol, time is slotted an
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!