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
oee [108]
3 years ago
11

Write a boolean method that checks whether a given positive integer n is a perfect square. Use Math’s sqrt and round methods to

find the square root of n, round it, then square the result and compare with n. Do not use any iterations or recursion.
Computers and Technology
1 answer:
svetoff [14.1K]3 years ago
5 0
In java...

public boolean checkSquare(int n){

int actualNumber = n;
int squareRoot = (int)Math.sqrt(n);
int squaredNumber = Math.pow(squareRoot,2);

if(squaredNumber==actualNumber){
return true;
} else {
return false;
}

}
You might be interested in
Utility software can help you to
Allushta [10]
Utility software can help you to designed to help analyze,configure , optimize  or maintain a computer.
6 0
3 years ago
Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value o
Fantom [35]

Complete question:

Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex:  If the input is:  PYTHON

the output is: 14

part of the code:

tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8,  'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1,  'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 }

Answer:

Complete the program as thus:

word = input("Word: ").upper()

points = 0

for i in range(len(word)):

   for key, value in tile_dict.items():

       if key == word[i]:

           points+=value

           break

print("Points: "+str(points))

Explanation:

This gets input from the user in capital letters

word = input("Word: ").upper()

This initializes the number of points to 0

points = 0

This iterates through the letters of the input word

for i in range(len(word)):

For every letter, this iterates through the dictionary

   for key, value in tile_dict.items():

This locates each letters

       if key == word[i]:

This adds the point

           points+=value

The inner loop is exited

           break

This prints the total points

print("Points: "+str(points))

6 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
puteri [66]

Explanation:

Type the correct answer in the box. Spell all words correctly.

Ben has to type a long letter to his friend. What is the correct keying technique that Ben should use?

To prevent strain and key correctly, Ben should use his fingers gently over the keys with his wrist in a flat position.

7 0
3 years ago
Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
choli [55]

Screen reading for extended periods can cause a syndrome known as the computer vision syndrome

<h3>Computer vision Syndrome</h3>

What is computer vision Syndrome?

the computer syndrome is characterised by eye discomfort and fatigue, dry eye, blurry vision, and headaches, glare, etc. Uncorrected vision problems are a major cause. it is recommended to stay off the computer for at least thirty minutes to minimise the effects

Learn more about Computer vision Syndrome here:

brainly.com/question/8114244

7 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
allsm [11]

Answer:

Ground Antennas

Explanation:

I got it right on my test

5 0
3 years ago
Other questions:
  • When troubleshooting firewalls, which of the following is not something you should do after you attempt a fix?
    7·1 answer
  • What career is likely to have to highest salary
    14·2 answers
  • Explain the design and development proccess?
    15·1 answer
  • What role do mobile devices play in shaping the world?
    5·2 answers
  • List three examples of observations of earth by remote-sensing satellites
    6·1 answer
  • You have just installed a SOHO router in a customer's home and the owner has called to say his son is complaining that Internet
    5·1 answer
  • Why does the randomNumber function only use whole numbers between 0 and 1 (basically, 0 and 1)?
    13·1 answer
  • The process of auditing the source code for an application to verify that the proper security controls are present, that they wo
    14·1 answer
  • The data _____ component of a database management system (DBMS) is used to create and maintain the data dictionary. manipulation
    14·1 answer
  • May someone help me with the this question pls , The governor of a state wants to inform the people about a change in the tax po
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!