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
Olivia needs to get permission to use a graph of data gathered by a trade association she plans to include the graph in a report
balandron [24]

Answer: by reading the copyright notice on the website where she found the graph.

Explanation: ~Apex~

3 0
3 years ago
Read 2 more answers
Your team at amazon is overseeing the design of a new high-efficiency data center at hq2. a power grid need to be generated for
elixir [45]

Answer:

void print2(int row) {

for (int i = 0; i < row; i++) {

 char ch = 'a';

 char print = ch;

 for (int j = 0; j <= i; j++) {

  cout << print++;

 }

 cout << endl;

}

}

int count_digits(int num) {

int count = 0;

int temp = num;

while (temp != 0) {

 temp = temp / 10;

 count++;

}

return (num % count);

}

Explanation:

3 0
2 years ago
What do economists call a decline in the real GDP combined with a temporary rise in price level?
ad-work [718]
A <span>stagflation is my answer.</span>
3 0
3 years ago
Read 2 more answers
The numeric keys on the keyboard are sometimes called the ten keypad. true false
mr_godi [17]
The answer is true...
8 0
3 years ago
Read 2 more answers
Does an android tablet have a hard drive
Kisachek [45]
No, it uses flash menory
3 0
3 years ago
Other questions:
  • Driving while wearing headphones or earphones
    12·2 answers
  • Do you believe that OOP should be phased out and we should start working on some alternative
    6·1 answer
  • Why does my hp computer keep freezing when i move it?
    10·1 answer
  • [This is on Edhesive (coding and programming)]
    8·2 answers
  • Which operating system user interface does not reside on the computer but rather in the cloud on a web server?
    5·1 answer
  • Help help help help help!!!
    7·1 answer
  • Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number an
    7·1 answer
  • What are the main security weaknesses of coaxial cable, twisted pair cable, and fiber optic cable? How might the router itself b
    8·1 answer
  • How many domains are there in the classification system?
    13·1 answer
  • What starts with p and ends with orn
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!