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
Match common encryption algorithms and methods with the scenarios representing real-world business applications and requirements
Sladkaya [172]

The question is incomplete as the scenarios are not given that were to be matched by the given encryption algorithms.

By finding the question from internet i have attached the image of the scenarios in the form of table and answered below accordingly

<h2>Answer:</h2>

<u>Scenario A:</u>

Advanced Encryption Standard (AES) is a technique that uses 256-bit cipher texts for encryption process. The data encrypted by AES cannot be attacked and even it cannot be decrypted unless a brute-force search is used through all of possible 256-bit keys.For mobile security it is known as one of the best algorithms.

<u>Scenario B:</u>

Following are the techniques of encryption used for given scenario:

  • ECC
  • Digital Signature
  • AES
  • Blowfish

<u>Scenario C:</u>

Following are the techniques of encryption used for given scenario:

  • ECC
  • Blowfish

<u>Scenario D:</u>

Secure Sockets Layer (SSL) - SSL is a protocol that is commonly-used for managment of the message transmission security over the Internet)

<u>Scenario E:</u>

Advanced Encryption Standard (AES) - AES is an encryption algorithm used by U.S. Government agencies for securing sensitive but unclassified material .

i hope it will help you!

5 0
1 year ago
A city government is attempting to reduce the digital divide between groups with differing access to computing and the Internet.
sergeinik [125]

Answer:

C

Explanation:

Putting all government forms on the city web site is the least activity likely to be effective in the purpose of reducing digital divide.

Holding basic computer classes at the community centers will very much help to reduce the digital divide.

Providing free wireless internet connections at locations in low-income neighborhood will also reduce the gap of digital divide

Requiring that every city school has computers that meet a minimum hardware and software will made computing resources available to users thereby reducing digital divide.

5 0
1 year ago
Please help!! Caleb is working on a simple logic-based program to simulate a game of tic-tac-toe. Which programming language wou
irga5000 [103]

Basic language should do it

4 0
2 years ago
Given a int variable named yesCount and another int variable named noCount and an int variable named response write the necessar
sergejj [24]

// This command takes input from the user.

Scanner input = new Scanner(System.in);

int response= input.nextInt();

// Making the variables required

int noCount =0 ;

int yesCount =0;

// Checking the response if it is 1 or 2 and reporting accordingly

if(response == 1 || response ==2){

 yesCount+=1;

 System.out.println("YES WAS RECORDED");

}

// Checking if the input is 3 or 4 then printing the required lines

else if (response == 3 || response ==4){

noCount+=1;

 System.out.println("NO WAS RECORDED");

}

// if the input is not valid than printing INVALID

else{

System.out.println("INVALID");

}

 

 

 

6 0
2 years ago
A(n) key is the set of steps used to convert an unencrypted message into an encrypted sequence of bits that represent the messag
a_sh-v [17]

Answer:

Algorithm

Explanation:

Algorithm is a set of instructions designed to perform a specific task, an independent sequence of actions to be perform to solve a problem and instruction for performing a computation.

Algorithm is A(n) key set of steps used to convert an unencrypted message into an encrypted sequence of bits that represent the message; it sometimes refers to the programs that enable the cryptographic processes.

5 0
1 year ago
Read 2 more answers
Other questions:
  • Computer design software requires __________________ to be used properly and successfully by architects.
    9·2 answers
  • A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
    10·1 answer
  • Rob creates a Course_Details table that has four columns: Course _ID, Course_Name, Semester and Credits. A course may have 0.5 c
    6·2 answers
  • If you want to present slides to fellow students or coworkers which productivity software should you use to create them A. Word
    14·2 answers
  • When should a technician record a system's baseline data?
    10·1 answer
  • There are two methods of enforcing the rule that only one device can transmit. In the centralized method, one station is in cont
    5·1 answer
  • Who is currently using which computer at WP? Create an appropriate SQL query to answer this question. Show SerialNumber, Make, a
    7·1 answer
  • You need to design a data storage scheme for Hayseed Heaven library data system. There are several hundred thousand large data r
    8·1 answer
  • A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer
    14·1 answer
  • 7. Which of these statements is true? Agile is a programming language MySQL is a database HTML stands for "Hypertext Markup Link
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!