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
choli [55]
3 years ago
13

Write a function, factors, that takes an integer n, and returns a list of values that are the positive divisors of n. Note: 0 is

not a divisor of any integer, 1 divides every number, and n divides itself.
Computers and Technology
1 answer:
Helen [10]3 years ago
4 0

Answer:

public int[] factors(int n)

{

int arr[]=new int[n];

int count=0;

for(int i=1;i<=n;i++)

if(n%i==0)

{

arr[count]=i;

count++;

}

return arr;

}

Explanation:

Factors are the numbers you multiply to get another number. For instance, factors of 15 are 3 and 5, because 3×5 = 15.

In the program , we have an array of length N to store the factors.

Since we don't know the number of factors of N, so we have taken size of upper bound N to store list of factors in the array arr.

Within the loop the number gets divide by Integers from 1 to that number until result is 0. If it is 0, that number is stored in array.

You might be interested in
Which of the following factors wouldn't change an account's optimization score?
MatroZZZ [7]

Answer:

Renaming Campaigns

Explanation:

Based on the information provided within the question it can be said that the factor that wouldn't change this would be Renaming Campaigns. This is because an account's optimization score is an estimate of how well the account/campaign will perform in the near future. Changing the name will not change this score since the campaign is still following the same strategy and therefore the estimates will be the same.

8 0
3 years ago
Nolan has just created a linked cell to another cell in a separate worksheet in his current Excel 2016 workbook.
kipiarov [429]

Answer: dependent

Explanation:

A Cells containing formulas which refer to other cells are known as dependents.

These are cells that depend on values in the selected cell.

A dependents cell can either contain a formula or a constant value.

(Ctrl + ] ) Is used as a shortcut when selecting dependents cells in an active cell.

Another option is to make use of you (Tools > Formula Auditing > Trace Precedents).

4 0
3 years ago
Read 2 more answers
Write a program that asks the user for the number of males and the number of females registered in a class. The program should d
Bond [772]

Answer:

import java.util.Scanner;

public class PercentagePopulation {

public static void main(String[] args) {

 // 1. Create an object of the Scanner class

 // This will allow for user's inputs

 Scanner input = new Scanner(System.in);

 // 2. Create a prompt asking the user to enter the number of males

 System.out.println("Please enter the number of males");

 // 3. Receive the number entered by the user and store in an int

 // variable called  number_of_males.

 int number_of_males = input.nextInt();

 // 4. Create a prompt asking the user to enter the number of

               // females

 System.out.println("Please enter the number of females");

 // 5. Receive the number entered by the user and store in an int

 // variable  called, number_of_females

 int number_of_females = input.nextInt();

 // 6. Find the sum of the number of males and females

 // Store the result in an int variable called total.

 int total = number_of_males + number_of_females;

 // 7. Find the percentage of males by using the appropriate

 // formula.  Do a type-casting to allow for division in floating point

               // representation by prepending the number_of_males by (double)

 double percentagemales = (double) number_of_males / total * 100.0;

 // 8. Find the percentage of females by using the appropriate

 // formula.  Do a type casting to allow for division in floating point

               // representation by prepending the number_of_males by (double)

 double percentagefemales = (double) number_of_females / total * 100.0;

 // 9. Print out the results

 System.out.println("Percentage males : " + percentagemales + "%");

 System.out.println("Percentage females : " + percentagefemales + "%");

}

}

Explanation:

Please go through the comments in the code to give an explanation of the program. The source code file has also been added to this response. Please download it and go through it.

Download java
4 0
3 years ago
What is the full path and filename for the file on a Debian Linux distribution that displays the time zone settings?
lesya [120]

Answer:

/etc/timezone

Explanation:

Debian based Linux distribution is a free distribution software and an operating system. It is composed of a open source and free source software. It is one of the most popular distributions.

A computer file name is a unique system of identifying the computer stored file in the file system. The names of the different file system have different formats or extensions in the file name and imposed different file restrictions.

In the context, the full path and the file name of a file that displays a time zone settings on a Debian Linux distribution is " ../etc/timezone".

3 0
2 years ago
...............................
Gemiola [76]

............................

Mark me brainliest^^

7 0
2 years ago
Read 2 more answers
Other questions:
  • Esther has acquired an associate's degree in information technology and certifications in PageMaker and Illustrator. Which caree
    8·2 answers
  • If the pc­doctor software is installed on a computer's hard drive, what two different ways can the program be started?
    7·1 answer
  • Write a program that reads numbers from a file (or allow user to input data) and creates an ordered binary tree. The program sho
    8·1 answer
  • How does technology improve productivity at home? (Select all that apply.)
    5·1 answer
  • You have been employed as a technical consultant to a computer shop chain. You are given the task of creating a short consumer b
    12·1 answer
  • Nina is trying to learn more about how computers work. She has repeatedly read that the motherboard is the "brain” of the comput
    7·2 answers
  • What kind of a bug is 404 page not found
    10·2 answers
  • private int product(int n) { if(n &lt;= 1) return 1; else return n * product(n-2); } What is the output when product(6) is calle
    6·1 answer
  • ¡Hola! He visto en muchos comentarios de Twitter "svd" cuando alguien dice "dale fav a este Tweet y siganse entre ustedes" y en
    8·1 answer
  • Explain the concept of conditional formatting​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!