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
77julia77 [94]
4 years ago
7

Write a Program that uses the method sqrt. of the class Math and outputs the square roots of the first 25 positive integers. (Yo

ur program must output each number and its square root.)
Computers and Technology
1 answer:
LenKa [72]4 years ago
6 0

Answer:

The program to this question can be given as:

Program:

import java.lang.*;

class root    //define class  

{

int i;         //define variable

public void Squareroot()

 //define function

{

System.out.println("Number\tsquare root"); //print message.  

for(i=1;i<=25;i++)                  //use for loop

 {

  System.out.println(i+"\t"+Math.sqrt(i));  //print value and using square root function

 }

}

}

public class Main      //define class  

{

   public static void main(String[] ar)      //define main method

{

root ob= new root();   //create class object

ob.Squareroot();

 calling function

}

}

output:

Number   Square Root

1                    1.0

2                   1.414

3                   1.732

4                   2.0

5                   2.236

.

.

.

24                 4.898

25                 5.0    

Explanation:

In the above program firstly we declare a class that is root. In this class, we declare a variable(i) and function(Squareroot). In the function, we define a loop that uses the variable to print all the values. In the loop, we use the math square root function that is sqrt. This function is bind in java package i.e java.lang.*; This function returns square root that's value type is double. Then we define a main class in the main class we define the main function in the main function we create a root class object and call the function.

You might be interested in
company gives the following discount if you purchase a large amount of supply. Units Bought Discount 10 - 19 20% 20 - 49 30% 50
ratelena [41]

Answer:

In Python:

order = int(input("Order: "))

discount = 0

if(order >= 10 and order <20):

    discount = 0.20

elif(order >= 20 and order <50):

    discount = 0.30

elif(order >= 50 and order <100):

    discount = 0.35

elif(order >= 100):

    discount = 0.40

price = order * 4.1

discount = discount * price

print("With your order of "+str(order)+" items, the total value will be $"+str(round(price,2))+" with a discount of $"+str(round(discount,2))+" for a final price of $"+str(round((price-discount),2)))

Explanation:

This prompts the user for number of orders

order = int(input("Order: "))

This initializes the discount to 0

discount = 0

For orders between 10 and 19 (inclusive)

if(order >= 10 and order <20):

-----------discount is 20%

    discount = 0.20

For orders between 20 and 49 (inclusive)

elif(order >= 20 and order <50):

-----------discount is 30%

    discount = 0.30

For orders between 50 and 99 (inclusive)

elif(order >= 50 and order <100):

-----------discount is 35%

    discount = 0.35

For orders greater than 99

elif(order >= 100):

-----------discount is 40%

    discount = 0.40

This calculates the total price

price = order * 4.1

This calculates the pre discount

discount = discount * price

This prints the report

print("With your order of "+str(order)+" items, the total value will be $"+str(round(price,2))+" with a discount of $"+str(round(discount,2))+" for a final price of $"+str(round((price-discount),2)))

3 0
3 years ago
Which one is not an operating system?1.mac 2.Microsoft office3.Iso.3.Android
quester [9]
It's either microsoft or office. Based on research I would say office.

I really hope this helps you! :-)
6 0
3 years ago
The publisher tab in the application control allows you to manage the various certificates that are used to do what to binaries?
artcher [175]

The publisher tab in the application control allows you to manage the various certificates that are used to sign to binaries. Publisher allow executables of a particular vendor, signed by a security certificate issued to the vendor by a Certificate Authority. Also, all applications and binary files either added to or modified on an endpoint that are signed by the certificate are automatically added to the whitelist.

3 0
3 years ago
HELP LOTS OF POINTS
andrew11 [14]

My guess would be B and D.

3 0
3 years ago
Read 2 more answers
Which rules should be remembered when creating formulas using nested functions? Check all that apply.
White raven [17]

Answer:

Use an equal sign at the beginning of the formula (A)

Use open and close parenthesis for each set of nested functions (B)

Functions should be in CAPS

Separate functions with commas

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Exposing employee and customer personal data to an untrusted environment is an example of:
    9·1 answer
  • Whichof the following is not a standard method called as part of the JSPlife cycle?jspInit()jspService()_jspService()jspDestroy(
    12·1 answer
  • ________ are used to translate each source code instruction into the appropriate machine language instruction.
    11·1 answer
  • Computer is created by aliens?!
    14·1 answer
  • Refer to the exhibit, a technician applies the configuration in the exhibit to an unconfigured router. To verify the configurati
    13·1 answer
  • The operating system provides a ____, which is the means with which you interact with the computer
    5·1 answer
  • What type of code do computers typically use to operate? A. CSS B. HTML 5 C. HTML D. Binary
    12·2 answers
  • Which of the following is the BEST reason to use cash for making purchases? everfi
    15·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    15·1 answer
  • Would my phone still work if I snapped it in half?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!