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
astraxan [27]
3 years ago
9

Write a program that takes as input a number of kilometers and prints the corresponding number of nautical miles. Use the follow

ing approximations: A kilometer represents 1/10,000 of the distance between the North Pole and the equator. There are 90 degrees, containing 60 minutes of arc each, between the North Pole and the equator. A nautical mile is 1 minute of an arc.
Computers and Technology
1 answer:
Dmitrij [34]3 years ago
8 0
<h2>Answer:</h2>

import java.util.Scanner;

public class NauticalMiles{

   public static void main (String [ ] args){

      Scanner input = new Scanner(System.in);

      System.out.println("Please enter the number of kilometers");

      double km = input.nextDouble();

      double nm = 0.54 * km;

      System.out.println("The corresponding number of nautical miles is "  + nm);

    }

}

<h2>Explanation:</h2><h2></h2>

<em>1 => Pre-code analysis</em>

According to the question,

(a) <em>A nautical mile (nm) is 1 minute of an arc.</em>

=> 1 nm = 1 minute of an arc

(b)<em>There are 90 degrees, each containing 60 minutes of arc, between the North pole and the equator.</em>

=> Each of the degrees in 90 degrees has 60 minutes of arc

=> 1^{0} = 60 minutes of arc

=> 90^{0} = 90 x 60 minutes of arc

=> 90^{0} = 5400 minutes of arc

(c) <em>A kilometer (km) represents 1/10,000 of the distance between the North pole and the equator. </em>

=> A kilometer = (1 / 10000) x distance between the North pole and equator.

Remember that the distance between the North pole and the equator as shown in (b) above is 90 degrees which is equal to 5400 minutes of arc.

=> 1 km = (1 / 10000) x 5400 minutes of arc

=> 1 km = (1 / 10000) x 5400 x 1 minute of arc

As shown in (a) above, 1 minute of arc is 1 nautical mile(nm).

=> 1 km = (1 / 10000) x 5400 x 1 nm

<em>=> 1 km = 0.54 nm.</em>

=========================================================

<em>2 => The code analysis</em>

The code has been written in Java.

The following is the line-by-line explanation of the code written as comments.

// Import the scanner class to allow for user's inputs

import java.util.Scanner;

// Declare the main class to hold and run the application

public class NauticalMiles {

   // Write the main method where execution will begin

   public static void main (String [ ] args) {

      // Create an object <em>input </em>of the Scanner class  

      Scanner input = new Scanner(System.in);

     

      // Prompt the user to enter the number of kilometers

      System.out.println("Please enter the number of kilometers");

      // Store the user's input in a double variable called <em>km</em>

      double km = input.nextDouble();

      // Convert the input to nautical miles using the formula from the

      // pre-code analysis above. i.e 1km = 0.54nm.

      // Store the result in a double variable called <em>nm</em>

      double nm = 0.54 * km;

      // Print out the result (the nautical mile)

      System.out.println("The corresponding number of nautical miles is "  + nm);

    }       // End of main method

}            // End of class declaration

=========================================================

<em>3 => Sample output</em>

<em></em>

> Please enter the number of kilometers

>> <em>45</em>

> The corresponding number of nautical miles is 24.3

You might be interested in
What wireless security technology contains significant flaws and should never be used?
aalyn [17]

The wireless security technology contains significant flaws and should never be used is Wired Equivalent Privacy (WEP).

<h3>What is the primary weakness of Wired Equivalent Privacy WEP )?</h3>

Wired Equivalent Privacy (WEP) is known to be a kind of a security protocol, that is seen in the IEEE Wireless Fidelity (Wi-Fi) standard known to be 802.11b.

Note that the primary weakness of wired equivalent privacy (WEP) is that It functions only on some given brands of APs and as such, The wireless security technology contains significant flaws and should never be used is Wired Equivalent Privacy (WEP).

Learn more about wireless security from

brainly.com/question/25633298

#SPJ1

5 0
1 year ago
give one word • pressure exerted by a stationary liquid _______. • force in a direction perpendicular to a given surface area __
mel-nik [20]

Answer:

1. Hydrostatic pressure.

2. Pressure.

3. Equilibrium forces.

Explanation:

1. <u>Hydrostatic pressure</u>: pressure exerted by a stationary liquid. It is simply the pressure in a liquid such as water at a specific depth.

Mathematically, hydrostatic pressure is given by the formula;

H.P = rho * g * d

Where:

  • H.P is the hydrostatic pressure of a liquid.
  • rho represents the density of a liquid.
  • g is the acceleration due to gravity.
  • d is the depth (height) of a liquid.

2. <u>Pressure</u>: it is the force in a direction perpendicular to a given surface area. Thus, it's typically measured in Newton per meters (N/m²).

Mathematically, pressure is given by the formula;

Pressure = \frac {Force}{area}

3. <u>Equilibrium forces</u>: a pair of forces whose resultant is zero. It is also referred to as balanced forces because the resultant of all the pair of forces acting on a body or system is at equilibrium (balanced).

6 0
2 years ago
The number of __________ to your website that had not visited prior to the time frame being analyzed.
liq [111]

Answer:

First Time Unique Visitor

Explanation:

I majored in

4 0
2 years ago
Write a python function c that converts bitstring array back to an integer numpy array
tresset_1 [31]

Answer:

import numpy as np#importing numpy module with an alias np.

def c(bitstring_array):# defining function c.

   num_integer=bitstring_array.dot(2**np.arange(bitstring_array.size)[::-1])#bitstring conversion.

   return num_integer#returning integer array.

print("Enter bits")

Bit_l=input().split(" ")#enter space separated bitstring.

for i in range(len(Bit_l)):#iterating over the bitstring.

   Bit_l[i]=int(Bit_l[i])

bitstring_array=np.array(Bit_l)

print(c(bitstring_array))#function call.

Output:

Enter bits

1 1 1 0 0 1

57

6 0
2 years ago
When an ethernet nic has been configured by os to use half-duplex, the transmit pair of the twisted-pair cable uses?
Maurinko [17]
Simplex, simplex, and half duplex.

Hope this helps!!
8 0
3 years ago
Other questions:
  • In scratch the location of a sprite is defined by what?
    10·1 answer
  • The countryside presents
    11·1 answer
  • A user has been complaining that their wireless connection has been connecting and disconnecting too frequently. what command co
    15·1 answer
  • Which of the following is not given to a client computer when it is first installed on a TCP/IP network so that it has the appro
    9·1 answer
  • Which of the following should you do if your accelerator is stuck? A. Pump your brakes to build fluid pressure. B. Shift to Neut
    14·2 answers
  • Could someone please explain to me the an electrical circuit.
    13·2 answers
  • You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Whi
    10·1 answer
  • Is an electronics standard that allows different kinds of electronic instruments to
    12·1 answer
  • Which of the following is a characteristic of vector graphics?
    15·2 answers
  • each data mining technique has its advantages and limitations. which data mining technique mimics the neural structure of the br
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!