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
give the difference between functional and functional tools in the middle of to the circle give importance​
bija089 [108]

Answer:

hakkuna matata is the radious of a circle

5 0
3 years ago
Imagine that you are an independent filmmaker making a feature-length narrative film in the United States, with a variety of bot
Lerok [7]
Although an 8mm or 16mm would be better cost wise, I personally would use a 35 mm camera for this type of film. The 35mm is the only camera that would work well on a big screen. It is a rather expensive camera but no other camera could fit on the big screen.
7 0
3 years ago
Read 2 more answers
What are the different types of application architecture
ivann1987 [24]

Answer: There are many different types of application architectures, but the most prominent today, based on the relationships between the services are: monoliths and N-tier architecture, microservices, and event-driven architecture and service-oriented architecture.

Explanation: A layered or N-tier architecture is a traditional architecture often used to build on-premise and enterprise apps, and is frequently associated with legacy apps.

A monolith, another architecture type associated with legacy systems, is a single application stack that contains all functionality within that 1 application. This is tightly coupled, both in the interaction between the services and how they are developed and delivered.

Microservices are both an architecture and an approach to writing software. With microservices, apps are broken down into their smallest components, independent from each other. Each of these components, or processes, is a microservice.

With an event-driven system, the capture, communication, processing, and persistence of events are the core structure of the solution. This differs from a traditional request-driven model.

The service-oriented architecture (SOA) is a well-established style of software design, that is similar to the microservices architecture style.

3 0
2 years ago
Which of the following commands should you use to determine whether there are any shared resources on a Windows computer with th
Law Incorporation [45]

Answer:

c. nbtstat -a 193.145.85.202

Explanation:

Nbtstat is a TCP/IP utility which is used to display the current connections and statistics of TCP/IP using NetBIOS over TCP/IP (NetBT).

It is installed on a computer running Microsoft Windows when the TCP/IP protocol stack is installed.

Also, it is very useful when we want to troubleshoot NetBIOS name resolution problems.

One can run nbtstat -a < ComputerName > to obtain the local NetBIOS name table on <ComputerName> and its MAC address

7 0
3 years ago
Read 2 more answers
Please code in python and add comments to code
Gnoma [55]

#accepting input from user

n=int(input("Enter a number: "))

#entered number is stored in a temporary variable

temp=n

#initializng required variables

rev=0

dgt=0

#digits are reversed inside while loop

while(n>0):

dgt=n%10

rev=rev*10+dgt

n=n//10

#original number and its reverse are compared

if(temp==rev):

#if equal, it's a palindrome

print("It is a Palindrome")

else:

#if not equal, it's not a palindrome

print("It is not a Palindrome")

#◌⑅⃝●♡⋆♡Nåmřāthā♡⋆♡●⑅◌

4 0
2 years ago
Other questions:
  • Which of the following is true of property?
    13·1 answer
  • Does anyone know how to cancel a Pandora Free Trial Subscription? I need to cancel it by tomorrow. Please help!
    12·1 answer
  • Technology is often discovered by accident
    5·1 answer
  • In chapter 3, we discussed syntax and semantics, in general there are two types of grammars for programming languages, regular a
    14·1 answer
  • The first numerical control machine tool was demonstrated in 1952 in the United States at the Massachusetts Institute of Technol
    14·1 answer
  • Write a Python3 program to check if 3 user entered points on the coordinate plane creates a triangle or not. Your program needs
    12·1 answer
  • ¡Hola! He visto en muchos comentarios de Twitter "svd" cuando alguien dice "dale fav a este Tweet y siganse entre ustedes" y en
    8·1 answer
  • Explain the evolution of programming language​
    15·1 answer
  • For her presentation on Italy, Matilda used a red background with light green text. When her friend critiqued her presentation,
    12·1 answer
  • True or false: if you are adding your own css sheet, make sure your css file comes before the bootstrap css file.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!