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
20 points/ When creating a storyboard, in which section do you mention how you move from one shot to the next?
kondor19780726 [428]

Answer:

Transition  section helps us to move from one shot to the next.

Explanation:

Synopsis: This tells actually what is the story is all about. We can call that as a “short description about the story”.

Sketch: It is the drawing window, where we pictorially represent the story.

Transition: This actually tells us about the next move.

Shot description: We can consider a “shot” as one of the scene in the story. So, it shot contain image and its description.

Shot Sequence: This is for “Pre-visualizing” video.

Among all the choice, Transition option takes the write definition.

5 0
3 years ago
1. in terms of technology, we often said to be living in the _____ age.???
sleet_krkn [62]
I think its the new age either that or end times
3 0
3 years ago
Read 2 more answers
Several of the items below indicate the steps required to move a slide to a different location in a presentation. Select those s
Llana [10]

Answer:

1 - Select the slide you want to move

2- Hold down the mouse button

3- Drag the slide where you want it

4 - NA

5- NA

6- NA

Explanation:

1 - Select the slide you want to move

it allows us to select the slide which we want to move by just clicking left mouse button

2- Hold down the mouse button

it allows the selected slide to stick with cursor

3- Drag the slide where you want it

It allows the slide stick with the cursor to drag it by moving the cursor to the required position

4 - NA (Choose move from the toolbox menu)

There is on toolbox against the slide as toolboxes are only available within a slide that is what we are writing on the slides

5- NA (Enter the slide position you want)

There is no command line in which we may enter the slide position to move the slide to a different serial number

6- NA (Switch to the Notes view)

Switching to notes view allows us to write notes with the corresponding slide whereas it doesn't do anything related to moving the slide

5 0
3 years ago
Google’s adwords system provides a quality score as a measure of _____, which indicates the usefulness of an ad message to consu
Vanyuwa [196]
The term that best fit the blank is RELEVANCE. The Google Adwords system is a system that is created by Google for the purpose of advertising online. Therefore, relevance is very important in this aspect as this shows how useful the ad is to the consumers who are doing the google search.
3 0
3 years ago
4. What two important events occurred early in the formation of the universe?
Annette [7]
C. When they separated it created the big bang
4 0
3 years ago
Other questions:
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • A network technician is tasked with designing a firewall to improve security for an existing FTP server that is on the company n
    9·1 answer
  • How are computers used in producing weather forecasts?
    8·1 answer
  • You have just purchased a motherboard that has an LGA 1156 socket for an Intel Pentium processor. What type of memory modules wi
    14·1 answer
  • PLEASEEE HELPPP
    7·1 answer
  • What is a key differentiator for Accenture when delivering Artificial Intelligence (AI) solutions to clients?
    11·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    13·1 answer
  • To obtain your class E learner license, youll need too _
    9·1 answer
  • How to check the at&t internet speed on my computer
    9·1 answer
  • the first thing to do when your computer gives you an error message is A restart the computer B press the F2 key C write down th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!