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
Greeley [361]
3 years ago
13

Write a program that declares named constants to represent the number of inches, feet, and yards in a mile. Also declare a varia

ble to represent a number of miles and assign a value to it. Compute and display, with explanatory text, the value in inches, feet, and yards. Save the program as MileConversions.java.
Computers and Technology
1 answer:
sweet [91]3 years ago
3 0

Answer:

// program in java.

// package

import java.util.*;

// class definittion

class MileConversions

{// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       // variables

       final double inc_mile = 63360.0;

   final double ft_mile = 5280.0;

   final double yd_mile = 1760.0;

// Scanner object to read input

   Scanner scr = new Scanner(System.in);

   System.out.print("Enter miles: ");

   // read miles from user

   miles = scr.nextDouble();

   //convert miles in inches,feet and yards

   System.out.printf("%.1f miles is %.1f inches, or %.1f feet, or %.1f yards.", miles, miles*inc_mile, miles*ft_mile, miles*yd_mile);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare variable to store inches, feet and yards in one mile.Read the miles from  user with scanner object.Convert miles into inches, feet and yards.Print these  values.

Output:

Enter miles: 55                                                                                                            

55.0 miles is 3484800.0 inches, or 290400.0 feet, or 96800.0 yards.

You might be interested in
What are 6 steps to take to figure out what's wrong with your computer?
lisabon 2012 [21]

Answer

  1. located the problem
  2. Go to system settings
  3. Try to uninstall and install the program
  4. Try troubleshooting the program
  5. Try contacting the device admin
  6. Read the user Manuel before try to do anything on the system
6 0
4 years ago
Which of the following is NOT true of input validation?
RUDIKE [14]

Answer:

Option A

Explanation:

Input Validation is the best possible testing of any information provided by a client or application. Info approval keeps inappropriately shaped information from entering a data framework.

In this the input validation on the server site can be exploited easier than the client side validation.

4 0
3 years ago
In order to place a gradient within a stroked path for type, one must convert the type using the __________
Black_prince [1.1K]

Answer:

in order to place a gradient within a stroked path for type ,one must convert the type 17316731

7 0
3 years ago
Which of the following is a proper use of the application, netstumbler
Studentka2010 [4]

Where are the answers for the questions that you are able to pick from?


3 0
4 years ago
Read 2 more answers
Which engineer may design a GPS for a vehicle?
Crank

Explanation:

Mechanical engineer may design a gps for a vehicle.

4 0
3 years ago
Other questions:
  • The equation y=2x+1 represents a function true or false
    11·1 answer
  • A computer hacker usually gets into a companyâs network by _____.
    15·1 answer
  • Define the missing method. licenseNum is created as: (100000 * customID) + licenseYear. Sample output: Dog license: 77702014
    14·1 answer
  • Consolidating a system's physical and time resources is known as ________________.
    13·1 answer
  • You have just built a new system from scratch. you turn the computer on but the system boot fails and sounds a beep code. what m
    15·1 answer
  • Which type of market are you in if your firm, along with three other firms, controls 95% of the total music industry?
    13·1 answer
  • Students who respond promptly to e-mails are following which netiquette rule?
    13·2 answers
  • Select the correct answer.
    8·1 answer
  • What method of technical drawing uses converging lines?
    7·1 answer
  • Relationship between application system<br>.and database​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!