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.

Answers

Answer 1
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;
}

}
Answer 2

Math’s sqrt and round methods to find the square root of n and  boolean method is given below.

What is boolean method?

The boolean method transforms object1's value to Boolean and returns true or false. The exists method determines if a value exists in object1. It returns Boolean true if a value is present; else, it returns Boolean false. The false procedure always yields the Boolean value false.

The sqrt() function in Math. Returns the cube root of an integer. The sqrt and round techniques of mathematics, as well as the boolean approach, are described here.

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;

}

Learn more about boolean here:

https://brainly.com/question/7491955

#SPJ2


Related Questions

If a business wanted to play an artist’s song in the background of their website, it must first consider the _____ of the music to ensure no laws are being broken.

Answers

no copyright laws being broken. the answer is copy right.

Answer:

copyright

Explanation:

Copyright is the set of national and international legal principles and norms that protect the creation of intellectual works by human beings.

There are two traditional legal conceptions of intellectual property: disseminated in the area of ​​influence of Anglo-American law and copyright, prevailing in the area of ​​influence of Latin law. In addition, there is now another conception, of a universal nature, free licenses, which some call "copyleft". And there is also the public domain. The first two have their origin in the monopolies that the monarchs granted to the authors to stimulate intellectual creation, and coincide in protecting the rights of the authors by granting them the power to exclude all other people from the use of the works, except the simple and individual reading, visualization, listening.

Which of the following lines of distribution best describes the diagram?

A: retail distribution
B: direct distribution
C: distribution by agents or brokers
D: wholesale distribution

Answers

A) retail distribution.

Answer

retail distribution

Explanation

Retail distribution is the process or path that a manufactured good takes to reach its intended consumer. Manufacturers employ different retail distribution strategies for the purposes of interacting with customers.Sometimes the distribution channel is direct, such as when a consumer purchases a product directly from company without involving any intermediary.

What is the name of a coding scheme that assigns a specific numeric code to each character on your keyboard?

Answers

python is the answer to your question

I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone know what is wrong or how much it would be to fix it?

Answers

The most probable answer is that their was a short on the charger causing your phone's charging port to blow out. You can fix this yourself with a hot air soldering gun to remove the charging port and replace it with an identical port but it is not recommended if you have a warranty. As for prices it depends on the phone.

A team wants to set up a computer lab for their library. Members would be able to access and read books using the computers in the library. After researching about risks, they decide to install only desktop computers instead of tablets. This strategy might prevent the risk of computers being stolen. Which risk management technique are they following?

A.) risk acceptance
B.) risk mitigation
C.) risk avoidance
D.) risk transfer

Answers

C . Risk avoidance
they don't want anyone to steal their stuff so they get their desktops to avoid anything getting stolen

Which type of attack attempts to overwhelm network links and devices with useless data?

Answers

A DDoS attack is a type of network attack that overwhelms a network with pointless data to the point that normal users can't get access to basic functions. This was notably done to The Playstation Network several years ago.
Final answer:

A Distributed Denial of Service (DDoS) attack attempts to overwhelm network links and devices with useless data.

Explanation:

The type of attack that attempts to overwhelm network links and devices with useless data is called a Distributed Denial of Service (DDoS) attack.

In DDoS attacks, hackers flood a target network or website with an enormous amount of traffic, making it unable to handle legitimate requests. This is achieved by using a network of compromised computers called a botnet to send the malicious traffic.

For example, hackers might use a DDoS attack to target an online shopping website during a busy holiday season, causing the site to slow down or even crash, preventing customers from accessing the site.

A(n) ________ variable is declared inside a module and cannot be accessed by statements that are outside the module.

Answers

local






----------------------------------------------------

In addition to displaying subtotals, the subtotal feature "____" your worksheet so you can control the level of detail that is displayed.

Answers

In addition to displaying subtotals, the subtotal feature "outlines" your worksheet so you can control the level of detail that is displayed. The statement suggests that the displayed details levels are controlled in displaying subtotals in the subtotal feature table.

If using the md5 hashing algorithm, what is the length to which each message is padded?
a. 32 bits
b. 64 bits
c. 128 bits
d. 512 bits

Answers

If using the MD5 hashing algorithm, the length to which each message is padded 512 bits.

Answer: (d.) 512 bits.

MD5 stands for Message Digest 5. It is a hashing algorithm that is case sensitive.  It is a cryptographic hash values.

The last host address on the 10.15.25.0/24 network is

Answers

10.15.25.254 or 10.15.25.254/24
Final answer:

The last host address on the 10.15.25.0/24 network is 10.15.25.254. The /24 network provides 256 possible addresses, but the first and last addresses are reserved for network and broadcast addresses respectively.

Explanation:

In a /24 network, the last octet (8 bits) of the IP address is used for identifying hosts. The 10.15.25.0/24 network range offers 256 possible addresses, from 10.15.25.0 to 10.15.25.255. Among these, 10.15.25.0 is the network address and 10.15.25.255 is the broadcast address. Therefore, the last host address - the final usable IP address within this network - is 10.15.25.254.

Learn more about IP Address here:

https://brainly.com/question/35862697

#SPJ6

The default dfs namespace mode is windows server 2008, which supports up to 50,000 folders. how many folders does using non-windows server 2008 provide?

Answers

35 millions folders windows servers

The ____________ method can be used to convert a string to an int.

Answers

parseInt()





----------------------------

The term "net radiation" refers to _____ the total amount of energy received by earth. the total amount of energy radiated by earth. the difference in amount of incoming and outgoing radiation. radiation emitted by satellite networks.

Answers


The term "net radiation" refers to the difference in amount of incoming and outgoing radiation the total amount of energy received by earth.

Energy comes from the sunlight penetrates the top of the atmosphere- that's the incoming energy. Then some of it is lost by reflection of clouds or the Earth's surface, thermal radiation- that's the outgoing energy.

You try to enter your name into a cell that accepts a numeric value. What error would you receive

Answers

A. #NAME

B. #VALUE

C. #REF

D. #####

E. #DIV


#VALUE on plato

your answer is B. #VALUE

_____ rows indicate that there is different formatting for odd and even rows.

Answers

Banded rows indicate that there are different formatting for odd and even rows.

Why is the definition for second based on the Cesium 133 atom?

Answers

It is qualitatively defined as the second division of the hour by sixty, the first division by sixty being the minute. The SI definition of second is "the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom".

a. True
b. False: the arguments in a module call and the parameters listed in the module header must be of compatible data types.

Answers

True ? They have to be of the same type, comatible isn't absolute enough. But I may be overthinking it.

In the dns naming convention, what character(s) separate(s) a domain name from its subdomains?

Answers

In the dns naming convention, the domain name separates the sub-domains by "DOT" (.) character.

DNS or Domain Name System is written in a conventional method as Host. Domain. Root. This system allows only 255 characters while naming a domain that also includes the spaces in between. Sub-domain is the part of a large domain.

A type TW cable containing two No. 12 copper conductors has a maximum overcurrent protection of
A. 20 A.
B. 15 A.
C. 30 A.
D. 25 A.

Answers

i think it is 25 im not sure though

Answer:

A. 20 A.

Explanation:

The National Electrical Code (NEC) Table 310-16 states that unless there is another specific provision in this code, the overcurrent protection in relation to the conductor types that has an obelisk( ) mark shall not be greater than 15 amps for No. 14, 20 amps for No. 12, and 30 amps for No. 10 copper; or, in relation to aluminum and copper clad aluminum, it shall not be greater than 15 amps for No. 12 and 25 amps for No. 10 after factors for ambient temperature and number of conductors have been adjusted as necessary.

Therefore, a type TW cable containing two No. 12 copper conductors can not have more than 20 A (i.e. 20 amps) overcurrent protection.    

additional rows and columns are inserted into a table by using the _____ tab

Answers

insert tab
up at the top
have a nice day

Answer:

Layout

Explanation:

To add additional rows or columns, click anywhere in the table and click on the layout tab

To add rows ,click insert above or insert below.

To add columns click insert left or insert right.

Mike accidentally wrote a check for more than the balance in his checking account. The bank transferred money from his savings account to his checking account to cover the check. This banking service is _____.

Answers

Transfer. His back transfers money from one account to another.

Answer: The correct answer is overdraft protection.

Explanation: The service that a bank offers when they transfer money from the savings account to a checking account to cover an overdraft is called overdraft protection. Some banks may charge for this service, but others do it for free.

You need to upgrade memory in a system but you don't have the motherboard documentation available. you open the case and notice that the board has four dimm slots

Answers

The three yellow slots probably indicate triple channeling, which means the board uses DDR3 DIMMs. To know for sure, remove a DIMM and look for the position of the notch on the DIMM.

In normal view, powerpoint's ________ contains buttons such as notes, comments, and view.

Answers

In normal view, powerpoint's status bar contains buttons such as notes, comments, and view. Status bar is located at the bottom of the PowerPoint application window, and it is needed to show both all the information about the document and user's ability to change the settings of a presentation. Status bar includes such specific items as : zoom control, slide number, comments and note pane buttons and view control.

Which type of encryption is the most popular form of e-mail encryption?

Answers

Public Key Cryptography is the most popular form of encryption in emails. This type of encryption utilizes "keys" only known to the owner of the set of data. 

Write a program that will take an integer and add up each of the number’s digits, count the number of digits in the number, and then average the digits. You must use a while loop and % to access each of the individual digits. Use / to reduce the number so that you can average all of the digits.
Example: num = 123 can be taken apart with tempNum = 123 % 10 (which will pull off the 3), then tempNum = tempNum / 10 (will result in 12). Do this in a loop while the number is > 0.

Sample Data :
234
10000
111
9005
84645
8547
123456789


 Be sure to include print statements that will format the output as below.

Sample Output :
234 has a digit average of 3.0

10000 has a digit average of 0.2

111 has a digit average of 1.0

9005 has a digit average of 3.5

84645 has a digit average of 5.4

8547 has a digit average of 6.0

123456789 has a digit average of 5.0

Answers

For count digits, you could just convert it to a String and check the length
Sum digits, convert to string then seperate each character with charAt then convert it to numbers in the return statement.
Average digits you can convert it to a String and then convert them back after taking them apart.
Here is my solution:

import java.lang.System.*;

public class DigiMath {   

private static int countDigits(int number)
{
       int sum = 0;
       while(number > 0)
       {
           sum ++;
           number /= 10;
       }       return sum;   
}

private static int sumDigits(int number)   
{       
      int sum = 0;       
      while(number > 0) {
           sum += number % 10;
           number /= 10;
       }
       return sum;
}
   
   public static double averageDigits( int number )
   {
       int count = countDigits(number);
       if (count > 0) {
           return (double)sumDigits(number) / (double)count;      
       } else { 
            return 0; 
       } 
   }
   
   public static void PrintDigitAverage(int number)
   {
       System.out.printf("%d has a digit average of %1.1f\n", number, averageDigits(number));
   }
   
   public static void main(String[] args) 
   {
       // Method tests (run with java -ea)
       assert countDigits(12345) == 5 : "countDigits returns wrong count";
       assert sumDigits(12345) == 15 : "sumDigits returns wrong sum";
       assert averageDigits(12345) == 3.0: "averageDigits returns wrong average";

        PrintDigitAverage(234);
        PrintDigitAverage(10000); 
        PrintDigitAverage(111); 
        PrintDigitAverage(9005); 
        PrintDigitAverage(84645); 
        PrintDigitAverage(8547); 
        PrintDigitAverage(123456789);
   }
}


If your role model is from the same neighborhood as you or has the same ethnic background, _____.

Answers

your role model probably faced some of the same challenges as you will face
during your career

A touch screen is classified as a special type of scanning device true or false

Answers

The anwser is true. It is special type


A touch screen is a device that can be sued for making scree-related touches and is as it touch sensitive and measures the responses from the touches. It is a type of scanning device that is stylus uses the pressure and is used to make images on the screen.

Hence the option is false as the touch screen is not classified as a true scanner it don't scan and is only a touch-sensitive element.

Hence the option False.

Learn more about the classified as a special type of.

brainly.com/question/19636949.

The android operating system is used by many popular tablet computers. which tablet does not use the android operating system

Answers

Apple Ipad and Microsoft Tablets.

Software that instructs the computer how to run applications and controls the display/keyboard is known as the /7367008/81dc7fcb?utm_source=registration

Answers

The answer is the alu arithmetic logic unit. (:

which type of website would a business selling merchandise on the internet use? A person B information C commercial D social

Answers

I think it's C, commercial.
Other Questions
April is tested on her mastery of college chemistry. she is taking a(n) _____. A blacksmith heats a 1,540 g iron horseshoe to a temperature of 1445c before dropping it into 4,280 g of water at 23.1c. if the specific heat of iron is 0.4494 j / g c, and the water absorbs 947,000 j of energy from the horseshoe, what is the final temperature of the horseshoe-water system after mixing Clear, ambiguous acceptance criteria for all deliverables are important because they are the basis for verifying that the project scope has been completed in accordance with the customer's requirements and expectations. false true look at wiesel's discussions of the st. louis. how does this section of text follow from the section before it, and how does it connect to wiesels overall purpose? Describe what you would happen if you did not experience frictional forces as you walked what is an example of radiation? check all that apply Dog owners do not bear the full cost of the noise their barking dogs create and often take too few precautions to prevent their dogs from barking. local governments address this problem bya. subsidizing local animal shelters.b. making it illegal to "disturb the peace."c. encouraging people to adopt cats.d. having a well-funded animal control department. In 1 or 2 sentences, describe why sellers in a perfectly competitive market have no control over price. Which statement best explains why it can be difficult to identify a problem?a.) A problem can be simple or complicated.b.) A problem can be personal or emotional.c.) A problem can be large or small.d.) A problem can affect people or places. What is the ultimate goal of a designer? One number is 3 more than another. Their sum is -13. Find the numbers Why did w.e.b. du bois oppose booker t. washington's views on racial discrimination? Sterday, a movie theater sold 262 bags of popcorn. a large bag of popcorn costs $3. a small bag of popcorn costs $1. in all, the movie theater made $412 from popcorn sales. write and solve a system of equations to find how many bags of each size of popcorn were sold. In Luke Havergal how does the speaker show luke the importance of what she wishes him to do A) by describing the eastern dawn B) via comparing hell and paradise C) by reminding him of her kissD) by repeating "out of the grave I come" Click on the true statements about dna. (select all that apply.) Read this excerpt from a story: Drot slowed his horse as he came to the clearing in the forest. It was too quiet, and this was just the sort of place Budvar would pick to lay an ambush. "Budvar!" he yelled. "It is I, Drot." From what point of view is this story told? A.Alternating point of view B.First-person point of view C.Second-person point of view D.Third-person point of view Tammy wants to become a doctor when she grows up and find cures for deadly diseases. for her to achieve her goals, researchers would argue that the most important thing for her to do is: Ellen, an adult who has an intellectual disability, has just received a "token." based on this information, it is most reasonable to assume that ellen ________. Your thumb contains The only saddle joint in the entire body how would your hand function differently if your thumb contained a pivot joint what if it contained a ball and socket joint describe for consequences of having a different type of joint in the thumb What is the equation of the graphed line?enter answer in slope-intercept form in the box Steam Workshop Downloader