subject

Write a function called factors of number that takes as input a positive integer and returns the factors of the positive integer as an array. for example, if the integer is 6, the output is an array consisting of the values [1 2 3 6]. test your function on the following numbers: 26, 64, 97 and 187
1 and the number itself are always factors.
2. to find other factors, check up to the floor of the squareroot of the number. for example, if the number is 10, floor (squareroot 10) = 3.
a. 10 mod 2 equals 0. that means 2 and 5 (which is 10/2) are factors. in this case, it is ok to dynamically grow your array.
b. 10 mod 3 equals 1, which means 3 is not a factor. since we check up to 3, this completes the function and we return [1 10 2 5] as the factors of 10 (order is not important).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Write a function processpeople() that takes the name of a file as a parameter. each line of the file corresponds to information about a person. in particular a line contains either a name (in the form lastname,firstname with no spaces in it) or a name (lastname,firstname) and a year. the function will process the file, creating a person object for each line in the file. the function will print information about each line as it processes it, as well as appending the new person object into a list. make sure to use person methods to display information rather than recreating the work you did for the first problem. once the entire file has been processed, the function returns the list of person objects created from the file. if the file is empty, the function should return an empty list. if the input file cannot be opened, the function should print a message to that effect and then return an empty list. the following shows what would be displayed for two example files which have been provided in the link. the file none.txt does not exist. note that your function must work on an arbitrary file that consists of valid lines. you cannot assume anything about the file except that it contains lines that have the format described above.
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Given a link with a maximum transmission rate of 32.8 mbps. only two computers, x and y, wish to transmit starting at time t = 0 seconds. computer x sends filex (4 mib) and computer y sends filey (244 kib), both starting at time t = 0. statistical multiplexing is used, with details as follows packet payload size = 1000 bytes packet header size = 24 bytes (overhead) ignore processing and queueing delays assume partial packets (packets consisting of less than 1000 bytes of data) are padded so that they are the same size as full packets. assume continuous alternating-packet transmission. computer x gets the transmission medium first. at what time (t = ? ) would filey finish transmitting? give answer in milliseconds, without units, and round to one decimal places (e.g. for an answer of 0.013777 seconds you would enter "13.8" without the quotes)
Answers: 3
question
Computers and Technology, 25.06.2019 09:30
An output peripheral interacts with or sends data to the computer provides information to the user from the computer receives data from the computer and sends it to a modem stores data processed by the computer
Answers: 1
You know the right answer?
Write a function called factors of number that takes as input a positive integer and returns the fac...
Questions
question
Arts, 09.01.2022 14:00
question
English, 09.01.2022 14:00
question
History, 09.01.2022 14:00
Questions on the website: 13722363