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
pentagon [3]
3 years ago
10

Write a Java application that uses the Math class to determine the answers for each of the following: a. The square root of 37 b

. The sine and cosine of 300c. The value of the floor, ceiling, and round of 22.8 d. The larger and the smaller of the character ‘D’ and the integer 71 e. A random number between 0 and 20 (Hint: The random() method returns a value between 0 and 1; you want a number that is 20 times larger.) Save the application as MathTest.java.'
Computers and Technology
1 answer:
gayaneshka [121]3 years ago
5 0

Answer:

import java.util.Random;

public class MathTest {

   public static void main(String[] args) {

       int a = 37, b = 300;

       double c = 22.8;

       int max;

       System.out.println("The Square root of 37 is "+ Math.sqrt(a));

       System.out.println("The Sine of 300 is " + Math.sin(b) + " and the cosine is "+ Math.cos(b));

       System.out.println("The Floor, Ceiling and Round Value of 22.8 respectively are "+Math.floor(c)+", "+Math.ceil(c)

               +", "+Math.round(c));

       max = Math.max((int)'D',71);

       System.out.println("The Maximum between D and 71 is " +max );

       Random rand = new Random();

       int RandValue = rand.nextInt(20);

       System.out.println("A random Number between 0 and 20 is "+ RandValue);

   }

}

Explanation:

In order to get the square root of the number 37, the square root function is called by the statement Math.sqrt(a) since the value 37 has been assigned to a. Method calls are also applied to find the cosine, sine, floor, round and ceiling values for the respective variables.

To determine the maximum between the character 'D' and the integer 71, we first cast the character 'D' to an integer using this (int)'D'. Then we make the Method call Math.max( ).

To generate a random variable between 0 and 20, we first make an object of the class Random we use this object to obtain a random number between 0 and 20 by specifying the bound to 20 during the method call.

You might be interested in
Search engines use _____ to discover documents for indexing and retrieval.
disa [49]
The choices can be found elsewhere and as follows:

<span>a. caches
b. landing pages
c. Web crawlers
d. proxy servers
e. interstitials
</span>
I believe the correct answer is option C. Search engines use web crawlers to discover documents for indexing and retrieval. It is also known as spiders. It <span>is a software that traverses available Web links in an attempt to perform a given task.</span>
4 0
3 years ago
EdHesive 3.7 Code Practice?
devlian [24]

Answer:

if 3 + 3 == 6:

 print("Hey 3 and 3 is 6")

 if 5 + 3 == 8:

   print("You are not going to catch me")

   if 5 + 6 == 10:

     print("****nag*****")

   else:

     print("You thought like 5 + 6 = 11 ")  

     if 6 + 6 == 12:

       print("Great! This one is correct")

       if 5 + 7 == 12:

         print("Great, this is correct as well")

         if 3 + 3 == 4 and 5 + 5 == 10:

           print("Great! Congrats")

Explanation:

Please check the answer, and practice if else and various other ladders as much as you can.

8 0
4 years ago
Which wireless communication technology is most likely used when synchronizing device information to an automobile?
Over [174]

Answer:

Bluetooth

Explanation:

hope that helps bro

5 0
4 years ago
What may happen if a large number of computer users are attempting to access a web site at the same time that you are?
Maurinko [17]
A. You may be unable to link to the site.
<span />
4 0
3 years ago
Dns (domain name system) servers translate all domain names into _____.
pshichka [43]
They translate them into ip addresses.
5 0
4 years ago
Other questions:
  • Write a function cipher(plaintext, n) to shift all characters in a string of text. Your function should take 2 parameters, the p
    15·1 answer
  • After creating an organizational strategy based on porter's models, a company can?
    14·2 answers
  • Which type of view is created from the following SQL statement? CREATE VIEW balancedue AS SELECT customer#, order#, SUM(quantity
    15·1 answer
  • Which of the following is a Federal law that provides a definition of the term cyberterrorism and under which young people prima
    7·1 answer
  • Why does brainly keep saying “oops... something went wrong! Try again”
    7·2 answers
  • What is the primary benefit of using solid state storage
    7·1 answer
  • An aircraft departs an airport in the mountain standard time zone at 1615 MST for a 2-hour 15-minute flight to an airport locate
    14·1 answer
  • Double click on a sheet tab to ______ the sheer
    9·2 answers
  • You install a new driver, but your device still doesn't work. What is the first thing you should do?
    14·1 answer
  • Files containing ____ are available from a variety of sources.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!