answer.
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
mezya [45]
1 year ago
14

Write a program that asks the user to input an integer that is a perfect square. A perfect square is an integer that is equal to

the product of another integer with itself; e.g., 16 is a perfect square because it equals 4 times 4. Repeatedly force the user to input a new integer until they enter a perfect square. Once the user has entered a perfect square, print its square root as an integer. Hint: you can modulo a float by 1 to get the decimal part of the float, e.g., 2.75 % 1 equals 0.75, and 5.0 % 1 equals 0.
Computers and Technology
1 answer:
BlackZzzverrR [31]1 year ago
3 0

Answer:

// program in python

# import math library

import math

#read input from user

num=int(input("enter an integer:"))

while True:

#find square root on input

   s_root=math.sqrt(num)

#find remainder of root

   r=s_root%1

#if remainder if 0 then perfect square

   if r==0:

       print("square root of the number is:",s_root)

       break

   else:

#if number is not perfect square then ask again

       num=int(input("input is not perfect square !!enter an integer again:"))

Explanation:

Read an integer from user.Find the square root of the input number and then find  the remainder of square root by modulo 1.If the remainder is 0 then number is perfect square otherwise ask user to enter an integer again until user enter a perfect square  number.

Output:

enter an integer:12                                                                                                        

input is not perfect square !!enter an integer again:16                                                                    

square root of the number is: 4.0    

You might be interested in
Splunk In most production environments, _______ will be used as the source of data input?
Wittaler [7]

Answer: Forwarders

Explanation:

Splunk is defined as the software technology which helps in organization of applications, examining and monitoring of the data and information analytics.It performs the operation of indexing, processing and gathering to produce graphs, alert ,report etc .

  • Forwarders are the component of Splunk software that gathers the information and transmit it to the Splunk clod for further analysis and processing .It is considered as the reliable method for input of data.

6 0
1 year ago
During which stage does the central processing unit analyze the instruction and encode it in the form of a number, and then gene
guapka [62]

Answer:

<em>a. fetch</em>

Explanation:

<em>The device collects a program command from its memory during the run cycle of the fetch. </em>

It then defines and performs the activities needed for that command.  The CPU continuously repeats the cycle of fetching, decoding, and executing a command while  the computer is switched on.

4 0
2 years ago
NEED ASAP!!
kow [346]

Answer:

because he needs to connect them all to the sane network (i think)

4 0
1 year ago
Find a 95% confidence interval for the mean failure pressure for this type of roof panel.The article "Wind-Uplift Capacity of Re
aliya0001 [1]

Answer:

The 95% confidence interval would be given by (2.351;3.525)    

Explanation:

1) Previous concepts

A confidence interval is "a range of values that’s likely to include a population value with a certain degree of confidence. It is often expressed a % whereby a population means lies between an upper and lower interval".

The margin of error is the range of values below and above the sample statistic in a confidence interval.

Normal distribution, is a "probability distribution that is symmetric about the mean, showing that data near the mean are more frequent in occurrence than data far from the mean".

\bar X represent the sample mean  

\mu population mean (variable of interest)

s represent the sample standard deviation

n represent the sample size  

2) Confidence interval

The confidence interval for the mean is given by the following formula:

\bar X \pm t_{\alpha/2}\frac{s}{\sqrt{n}}   (1)

In order to calculate the mean and the sample deviation we can use the following formulas:  

\bar X= \sum_{i=1}^n \frac{x_i}{n} (2)  

s=\sqrt{\frac{\sum_{i=1}^n (x_i-\bar X)}{n-1}} (3)  

The mean calculated for this case is \bar X=2.938

The sample deviation calculated s=0.472

In order to calculate the critical value t_{\alpha/2} we need to find first the degrees of freedom, given by:

df=n-1=5-1=4

Since the Confidence is 0.95 or 95%, the value of \alpha=0.05 and \alpha/2 =0.025, and we can use excel, a calculator or a table to find the critical value. The excel command would be: "=-T.INV(0.025,4)".And we see that t_{\alpha/2}=2.78

Now we have everything in order to replace into formula (1):

2.938-2.78\frac{0.472}{\sqrt{5}}=2.351    

2.938+2.78\frac{0.472}{\sqrt{5}}=3.525    

So on this case the 95% confidence interval would be given by (2.351;3.525)    

5 0
1 year ago
Ishmael would like to capture a selected portion of his screen and then capture actions he preforms on that selected portion. Wh
kompoz [17]

Answer:

Use the Insert Screen .

Explanation:

Remember, on most computer keyboard you'll find a button named "Insert Screen' which functions as a screenshot too. Also, note that if Ishmael is using Windows operating system he should simply do the following;

1. open the window you want to screenshot

2. click the Screenshot button

But to select a part of the screen he would need to use Screen Clipping which would allow him select the part of the window that he wants. ( It screen will look opaque)

3. the pointer would change to a cross, then he should press and hold the left mouse button and drag to select the part of the screen that he wants to capture.

5 0
1 year ago
Other questions:
  • Use a VLOOKUP function in cell I5 to identify and calculate the federal withholding tax. Use the tax rates from the range D21:E2
    15·1 answer
  • Create a division formula.
    9·1 answer
  • A contact list is a place where you can store a specific contact with other associated information such as a phone number, email
    9·1 answer
  • You have configured your firewall to authenticate a group of 100 users who are in your company. You set up the database of users
    14·1 answer
  • python Write a function that computes a future investment value at a given interest rate for a specified number of years. The fu
    11·1 answer
  • Which of the following is not true of how computers represent complex information
    5·2 answers
  • When should a developer begin thinking about scalability? 1 during the design phase 2during testing 3when traffic increases by 2
    14·1 answer
  • For a data structure, such as a stack, who is responsible for throwing an exception if the stack is empty and a pop() is called:
    13·1 answer
  • Write a static generic method PairUtil.minmax that computes the minimum and maximum elements of an array of type T and returns a
    7·1 answer
  • 3. Write a program to find the area of a triangle using functions. a. Write a function getData() for user to input the length an
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!