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
oee [108]
1 year 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]1 year 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
Use the values in the range A7:A8 to extend the list of years to the range A9:A11. 3. Use AutoFill to fill the range A9:H11 with
jok3333 [9.3K]

Answer:

Question is incomplete and it needs a proper XL sheet image and more details. I have assumed and answered this question.

1. Use the values in the range A7:A8 to extend the list of years to the range A9:A11

Ans : <em>Use Ctrl + select A7: A8 and drag till A9: A11 : This will extend the list </em>

<em />

<em>2. </em>Use AutoFill to fill the range A9:H11 with the formatting from the range A7:H8.

Ans : Apply format immediately to the cells A9: H11 below with the help of Auto Fill Handle. Using Auto fill button we can able to a cell format to the cell bellow of active cell by just double clicking on the auto fill button.

3. In cell B8, create a formula without using a function that multiplies the value in cell B7 by the value in cell B6 and then adds the value in B7. Update the cell reference to cell B6, from a relative reference to a mixed reference by making an absolute reference to row 

Ans : =($B7*$B6)+$B7

4. Copy the formula from cell B8 to the range B9:B11 and then copy the formulas from the range B8:B11 to the range C8:H11.

Ans:

1. Select the cell B8 that contains which has formula to be copied

2. Click inside the formula bar to activate it and select the entire formula by using mouse and keyboard.

3. Copy the selected formula and press Esc to deactivate the formula bar.

4. Select the cell  B9 : B11 in which you want the copy of the formula to appear.

5. Most range names refer to absolute cell references. This means that when you copy a formula that uses a range name, the copied formula will use the same range name as the original.

6. Paste the formula by using references.

7. Repeat the steps of 1 to 6 for B8:B11 for range C8:H11.

5. Switch to the Cost Estimates worksheet. In cell A9, create a formula using the AVERAGE function that calculates the average of the values in the range A5:A7, then copy your formula to cell D9.

Ans : =AVERAGE(A5:A7) and Copy it to D9 using answer given in 4.

Explanation:

8 0
1 year ago
Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search.
Zinaida [17]

Answer:

C) /etc/updatedb.conf

Explanation:

The locate command actually uses the configuration file located at /etc/updated.conf.

5 0
1 year ago
Read 2 more answers
A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info
Kipish [7]

Answer:

The sql query is given below.

Since we need to count of males and females for a particular blood group, we put xxx for the blood group.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors,

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

Explanation:

The clauses in the query are as follows.

1. SELECT: all the columns required in the output are put in this clause.

2. FROM JOIN ON: the table(s) from which the above columns are taken are put in this clause.

3. WHERE: any condition required to filter the output is put in this clause.

The query is explained below.

1. Find the number of male donors. Number of anything can be found using COUNT() function. A query is required since gender is included in deciding the type of donor.

2. The query is defined to find number of male donors as follows.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "M%"; )

3. In the previous query, LIKE operator is used since it is not defined what value is stored for male donors.

4. Similarly, the query to find the number of female donors is formed.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "F%"; )

5. Next, the final query is formed as follows.

SELECT: both COUNT() functions will come here.

FROM: table name

WHERE: specific blood group will be put here

GROUP BY: this clause is optional and is not used in this query.

HAVING: this clause is optional and is not used in this query.

6. The query after putting all clauses is shown below.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%"),

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%")

FROM DONOR

WHERE BG = xxx;

7. Alias is used in the above query for each column to get the final query.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors, COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

7 0
1 year ago
Assume the user types in 7 and 10. What is output by the following?
Marianna [84]

Answer:

Enter a number: 7

Enter a number: 10

Traceback (most recent call last):

 File "main.py", line 3, in <module>

   print (numi + num2)

NameError: name 'numi' is not defined

Explanation:

The typo in the print statement causes a run-time error, where obviously num1+num2 was expected, and an output of 17.

3 0
1 year ago
Kendall receives an email stating that a leading computer company is giving away free computers, asking her to forward the email
gavmur [86]

Explanation:

Kendall should report the email as scam and delete email instead of forwarding it. She should also run her virus protection software as these kind of emails on the Internet are mostly Fraud and can contain virus so the user should avoid them.

8 0
2 years ago
Other questions:
  • On the Picture Tools Layout tab, you can preview results of the numerous styles, borders, effects, and layouts by _______ comman
    7·2 answers
  • When Jen is planning to upgrade to a monitor with a better resolution, what should she be looking for in the new monitor? machin
    11·1 answer
  • What is the value of x after each of the following statements is encountered in a computer program, if x=1 before the statement
    9·1 answer
  • Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method. public cla
    14·1 answer
  • In this exercise, you will create a couple of helper methods for ArrayLists in a class called ArrayListMethods.
    10·1 answer
  • We Deliver trains its truck loaders how to set the packages in the delivery vehicles, so that when delivery drivers are pulling
    15·1 answer
  • Use Excel to develop a regression model for the Consumer Food Database (using the "Excel Databases.xls" file on Blackboard) to p
    13·1 answer
  • Which of the following should get a Page Quality (PQ) rating of Low or Lowest? Select all that apply. True False A page with a m
    8·1 answer
  • Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,
    7·1 answer
  • There are two cons to an OLTP database. Which of the following are a solution of these cons?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!