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
photoshop1234 [79]
2 years ago
14

9.4 Code Practice: Your task is to determine whether each item in the array above is divisible

Computers and Technology
1 answer:
wariber [46]2 years ago
7 0

Answer:

Explanation:

The following Python code is a function that takes in an array as a parameter, it then loops through the array determining if the element is divisible by 3. If it is it leaves it alone, otherwise it changes it to a 0. Then ouputs the array. A test case is shown in the attached image below using a sample array.

def divisible_by_three(array):

   for x in array:

       if x % 3 == 0:

           pass

       else:

           array[array.index(x)] = 0

   return array

You might be interested in
In C complete the following:
Crazy boy [7]

Answer:

#include <stdio.h>

void printValues ( unsigned char *ptr, int count) // count is no of cells

{

 for(int i=0; i<count; i++) {

   printf("%d ", ptr[i]);

 }

}

int main ( )

{

 unsigned char data[ ] = { 9, 8, 7, 5, 3, 2, 1} ;

 printValues( data, sizeof(data)/sizeof(data[0]) );

}

Explanation:

Remember that the sizeof() mechanism fails if a pointer to the data is passed to a function. That's why the count variable is needed in the first place.

3 0
3 years ago
You have instructed all administrators to disable all nonessential ports on servers at their sites. why are nonessential protoco
wlad13 [49]

The reason nonessential protocols are a security issue that you should be concerned about is that: A. nonessential ports provide additional areas of attack.

<h3>What is information security?</h3>

Information security can be defined as a preventive practice which is typically used to protect an information system (IS) that use, store or transmit information, from potential theft, attack, damage, or unauthorized access, especially through the use of a body of technologies, encryption, frameworks, processes and network engineers.

In Cyber security, the reason nonessential protocols are a security issue that an end user should be concerned about is that nonessential ports would provide additional areas of attack because all protocols have weaknesses based on the principle of least privilege.

Read more on information security here: brainly.com/question/14286078

#SPJ1

Complete Question:

You have instructed all administrators to disable all nonessential ports on servers at their sites. Why are nonessential protocols a security issue that you should be concerned about?

Nonessential ports provide additional areas of attack.

Nonessential ports can't be secured.

Nonessential ports require more administrative effort to secure.

3 0
1 year ago
Look at the following partial class definition, and then respond to the questions that follow it:
zhannawk [14.2K]

Solution :

a.

public Book($\text{String title}$, String author, $\text{String publisher}$, int $\text{copiesSold}$) {

 this.$\text{title}$ = $\text{title}$;

 this.$\text{author}$ = $\text{author}$;

 this.$\text{publisher}$ = $\text{publisher}$;

 this.$\text{copiesSold}$ = $\text{copiesSold}$;

b). $\text{public String}$ getTitle() {

 return $\text{title}$;

}

$\text{public void}$ setTitle($\text{String title}$) {

 this.$\text{title}$ = $\text{title}$;

}

$\text{public String}$ getAuthor() {

 return author;

}

$\text{public void}$ setAuthor(String author) {

 this.$\text{author}$ = $\text{author}$;

}

$\text{public String}$ getPublisher() {

 return $\text{publisher}$;

}

$\text{public void}$ setPublisher(String $\text{publisher}$) {

 this.$\text{publisher}$ =$\text{publisher}$;

}

public int get$\text{copiesSold}$() {

 return $\text{copiesSold}$;

}

$\text{public void}$ set$\text{copiesSold}$(int $\text{copiesSold}$) {

 this.$\text{copiesSold}$ = $\text{copiesSold}$;

}

4 0
2 years ago
What is the digital revolution and how did it change society? What are the benefits of digital media?
Rama09 [41]

Hello!

Before Social Media , Many people liked the old classical way and they had there own way to communicate with people. With social media everything changed . Companies started to grow and real face to face communication was  shrinking slowly . Kids locked themselves in there rooms to text friends and play games instead of playing outside. But technology does have a good affect for example if it wasn't for technology i wouldn't be able to help you right now ! If it wasn't for social media Wendy's wouldn't be able to Roast people . And contact over the phone would be limited .

HOPE I HELPED HAVE A BLESSED DAY!!


7 0
3 years ago
What are all the possible 4-digit codes you can make with the numbers 7, 0, 9, and 3?
Arte-miy333 [17]
0,7,0,0
9,9,0,0
7,7,7,7
3,9,0,7

Hope this helps
4 0
3 years ago
Read 2 more answers
Other questions:
  • Name the component used in first generation of computer​
    10·1 answer
  • What is the maximum number of VLANs that can be configured on a switch supporting the 802.1Q protocol? Why?
    11·2 answers
  • Please help! Answer this question if you know computer science very well. I need help with computer science.
    13·1 answer
  • A company wants to build a new type of spaceship for transporting astronauts to the moon. What should the company do first?
    15·2 answers
  • Visual media that gives the appearance of a movement can be a collection of graphics<br>​
    10·2 answers
  • Is there any difference beetween the old version of spyro released on the origional and the newer ones??? or is it only change i
    8·1 answer
  • The way a student prepares for a test or reviews academic material is referred to as
    8·2 answers
  • What is pollution?
    14·2 answers
  • If every company is now a technology company, then what does this mean for every student attending a business college
    8·1 answer
  • a benefit of cloud computing is scaling up or down as demand for your services increases or decreases. the word that is most ass
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!