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
Oliga [24]
2 years ago
13

Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value

is smaller than m's. Write the code necessary to compute the number of perfect squares between k and m. (A perfect square is an integer like 9, 16, 25, 36 that is equal to the square of another integer (in this case 3*3, 4*4, 5*5, 6*6 respectively).) Associate the number you compute with the variable q. For example, if k and m had the values 10 and 40 respectively, you would assign 3 to q because between 10 and 40 there are these perfect squares: 16, 25, and 36,.
PYTHON CODING
Computers and Technology
1 answer:
ehidna [41]2 years ago
8 0

Answer:

import math  

def isPerfectSquare(n):

 s = int(math.sqrt(n))

 return n == s*s

def countPerfectSquares(k,m):

 q = 0

 for i in range(k,m):

   if isPerfectSquare(i):

     q=q+1

 return q

print(countPerfectSquares(10,40))

Explanation:

Note that this is including the k, but excluding m. If you want to include m, write m+1 in the range expression.

You might be interested in
While all pages use HTML code, not all pages are written in
creativ13 [48]
Is this a question?

*Answer: not much information to answer with*
7 0
2 years ago
Read 2 more answers
Common separators or delimiters used when converting a table to text include _______________________ , paragraph marks, or comma
Anon25 [30]

Answer:

tabs.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users to type, format and save text-based documents.

In Microsoft Word 2019, the users are availed with the ability to edit the word document in the following view type;

I. View Mode.

II. Print Mode.

III. Drift Layout.

To easily and quickly convert text to tables in Microsoft Word, you should insert common separators between the text columns. The common separators or delimiters used when converting a table to text include tabs, paragraph marks, or commas.

Tabs or commas are used to indicate where the texts are divided into table columns while paragraph marks indicate where a new table row begins.

6 0
3 years ago
Your boss asks you to transmit a small file that includes sensitive personnel data to a server on the network. The server is run
mel-nik [20]

Answer:

a. Telnet transmissions are not encrypted.

Explanation:

Indeed, since <em>Telnet transmissions are not encrypted,</em> all the information sent, and even the characters typed in the telnet console are sent in clear text.

This is a security issue, since any other device in the same network will receive a copy of the information (packets) sent. For default, all the devices, except for the server expecting to receive the information, will discard the packets. However it is easy to actively <em>listen </em>and keep those packets, wich will contain the information in plain text and human readable.

4 0
3 years ago
You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
n200080 [17]
The answer is b. java Hi.class :)
8 0
2 years ago
In python how do you write for prime factors
olasank [31]

Answer:

The while loop is used and the factors of the integer are computed by using the modulus operator and checking if the remainder of the number divided by i is 0. 3. Then the factors of the integer are then again checked if the factor is prime or not.

Explanation:

google

4 0
3 years ago
Other questions:
  • Okay so, not really a question but whatever it’s been bothering me.
    9·2 answers
  • You run an automobile selling company that has a popular online store on AWS. The application sits behind an Auto Scaling group
    6·1 answer
  • Your boss wants to utilize some sort of cloud storage for his files so that all of his
    10·2 answers
  • A company needs to store its documents in one place, share news and information with all staff, and allow access for employees w
    8·1 answer
  • Exploring Arraylists. Remember that arraylists are good for adding and removing things, and that they are clock-cycle friendlier
    13·1 answer
  • A function is executed when it is
    7·1 answer
  • In a ______topology, every device has exactly two neighbors for communication purposes. A failure in any cable or device can tak
    15·2 answers
  • What are the features of G-mail <br><br>(Write in your own words)​
    10·2 answers
  • Consider the following instructions for a game element: Move Forward If not at end, move forward Else stop This is an example of
    10·1 answer
  • A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departme
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!