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
Write a program that reads in an integer, and breaks it into a sequence of individual digits. Display each digit on a separate l
Montano1993 [528]

Answer:

The program in Python is as follows:

num = int(input())

for i in str(num):

   print(int(i))

Explanation:

This gets input for the number

num = int(input())

This converts the number to string and iterates through each element of the string

for i in str(num):

This prints individual digits

   print(int(i))

4 0
2 years ago
Write a test program that creates two Rectangle objects—one with width 4 and height 40 and the other with width 3.5 and height 3
BARSIC [14]

Answer:

public class Rectangle {

   private double width;

   private double heigth;

   public Rectangle(double width, double heigth) {

       this.width = width;

       this.heigth = heigth;

   }

   public double getWidth() {

       return width;

   }

   public void setWidth(double width) {

       this.width = width;

   }

   public double getHeigth() {

       return heigth;

   }

   public void setHeigth(double heigth) {

       this.heigth = heigth;

   }

   public double perimeter(double width, double heigth){

       double peri = 2*(width+heigth);

       return peri;

   }

   public double area(double width, double heigth){

       double area = width*heigth;

       return  area;

   }

}

class RectangleTest{

   public static void main(String[] args) {

       //Creating two Rectangle objects

       Rectangle rectangle1 = new Rectangle(4,40);

       Rectangle rectangle2 = new Rectangle(3.5, 35.7);

       //Calling methods on the first Rectangel objects

       System.out.println("The Height of Rectangle 1 is: "+rectangle1.getHeigth());

       System.out.println("The Width of Rectangle 1 is: "+rectangle1.getWidth());

       System.out.println("The Perimeter of Rectangle 1 is: "+rectangle1.perimeter(4,40));

       System.out.println("The Area of Rectangle 1 is: "+rectangle1.area(4,40));

       // Second Rectangle object

       System.out.println("The Height of Rectangle 2 is: "+rectangle2.getHeigth());

       System.out.println("The Width of Rectangle 2 is: "+rectangle2.getWidth());

       System.out.println("The Perimeter of Rectangle 2 is: "+rectangle2.perimeter(4,40));

       System.out.println("The Area of Rectangle 2 is: "+rectangle2.area(4,40));

   }

}

Explanation:

  • Firstly A Rectangle class is created with two fields for width and heigth, a constructor and getters and setters the class also has methods for finding area and perimeters
  • Then a RectangleTest class containing a main method is created and two Rectangle objects are created (Follow teh comments in the code)
  • Methods to get height, width, area and perimeter are called on each rectangle object to print the appropriate value
5 0
2 years ago
What are some preferences you can set in photoshop?
pishuonlain [190]

Answer: face brightness

Explanation:

hope this is the right answer :)

5 0
2 years ago
is a private connection of LANs and WANs that belongs to an organization, and is designed to be accessible only by the members a
Sedaia [141]

Answer:

Intranet.

Explanation:

The intranet will provide the sharing of information within the organization. It does not provide the accessibility of the network or the sharing of information outside the organization. The main advantage of the Intranet is to improve communication between the employees.

The intranet is a private connection of LAN and WAN which are belongs to an organization it means this network is authorized by the employee within organization not outside the organization .

7 0
2 years ago
How do you determine latitude using an astrolabe?
miv72 [106K]
This was really useful in determining one's location during the times when technology wasn't that advanced yet. First is that it depends as to what time of the day is it being used. If used at day, most probably at high noon, the altitude of the sun would be measured and recorded and/or remembered. Most of the times, the latitude is determined during the day since it is much easier. At night, a star of known declination will be substituted to the sun. Most of the times, the North Star is used. Then, an almanac will be utilized to determine the declination of the Sun or the star, depending on which was used. After which, the formula is applied, which is latitude = 90 degrees - measured altitude +declination.
3 0
3 years ago
Other questions:
  • Henri is working in a complex financial spreadsheet that has hundreds of columns of data. If he is at column AN and would like t
    11·1 answer
  • Which of the following characters at the beginning of a cell signifies to Excel that it should perform a calculation for the val
    13·1 answer
  • ____ are systems in which queues of objects are waiting to be served by various servers
    5·1 answer
  • What is data anayltics
    5·1 answer
  • Which is an example of correct HTML?
    10·1 answer
  • 1. Itemise the order in which BASIC executes arithmetic operation.
    13·1 answer
  • Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program s
    15·2 answers
  • Hazel has just finished adding pictures to her holiday newsletter. She decides to crop an image. What is cropping an image?
    10·1 answer
  • What are some innovations that television has undergone since its original invention ?
    11·1 answer
  • Ssssssssssssssssssssssssssssssssssssssssssssssssss 100 points for this answer too.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!