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
Which network component blocks status?
SIZIF [17.4K]

Answer:

Router

Explanation:

It will reads the data packet's destination address .

Looks up all the paths it has available to get to that address.

7 0
3 years ago
Which phrase best describes a spreadsheet?
Marrrta [24]
A Spreadsheet is a interactive computer application for organization, anaylsis and storage data in tabular form. Hope it helps!

~A.R.M.Y
8 0
3 years ago
Read 2 more answers
Which statement about routers is !!!FALSE!!!
monitta

Answer:

b. they are located at the intersections of the network of wires and cables that make up the internet.

Explanation:

Given that Router is a computer networking device that operates by transferring data packets between computer networks, while also ensuring traffic organizing tasks on the Internet.

Hence, Routers put packets in the right order after they arrive at their destination by matching the destination IP address of the packet and one of the addresses in the routing table.

Also, Routers check the address on each packet that arrives and decide which way it should go next​ by ensuring the data packets are summarized for the outgoing interface recorded in the table entry.

Therefore, the correct answer is option B

8 0
3 years ago
If you could create a social network, what would it be like? What would make it so special about the others? (If you want you ca
patriot [66]
Be able to contact and connect with other users. be able to share what your doing.
7 0
4 years ago
How many parts does status bar consist ?​
Maslowich

Answer:

here you go

Explanation:

256 parts

I hope it helped

8 0
2 years ago
Read 2 more answers
Other questions:
  • What Coding program does UNITY use?
    6·1 answer
  • It is important that data being imported from a text file into access are separated by a character, such as a comma, which defin
    8·1 answer
  • An athlete runs every day for five days. Write a program that computes the total distance and average distance ran by the athlet
    10·1 answer
  • How does a main program recieve info from a function in c++?
    6·1 answer
  • What is a credit card reader usually paired up with in order to take a credit card transaction?
    11·1 answer
  • explain the following with regard to a microcomputer. 1)program 2)stored program concept 3)instruction decoder
    5·1 answer
  • Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns
    14·1 answer
  • TABLE TEST
    12·1 answer
  • The encapsulating security ______ protocol provides secrecy for the contents of network communications as well as system-to-syst
    14·1 answer
  • MmfbfMMMMMMMMMMMMMMMMMmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!