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
Assignment directions the owner of a popular local coffee shop has approached you to design a network for his business. he would like to offer his customers wifi access to the internet, but also thinks it might be handy to network the kitchen and store room together with the office computer he already uses for ordering, scheduling, and payroll. he thinks that might save him time doing inventory control and ordering. your assignment is to create a set of questions for him that will precisely define the purpose of the network and any constraints and restrictions on its implementation. assignment guidelines create a list of at least ten questions to ask your customer. of those ten questions, at least one question must come from each of the following subject areas: purpose of the network network access and security issue network availability and fault tolerance issues future expansion issues vendor issues briefly explain in two or three sentences why you would ask each question and what you expect to learn from your customer’s response. submission requirements your questions should meet the criteria of a good survey question by being specific, unambiguous, and closed-ended. all questions, as well as your explanations, should be written in proper english using correct grammar, spelling, and punctuation. use complete sentences, and do not use slang, texting abbreviations, or shortcuts.
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 23.06.2019 23:40
4. what is the reason for including the following code snippet in the header file animal.h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
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
Physics, 24.08.2019 20:00
question
Biology, 24.08.2019 20:00
Questions on the website: 13722362