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
daser333 [38]
3 years ago
10

There are 12 inches in a foot and 3 feet in a yard. Create a class named InchConversion. Its main() method accepts a value in in

ches from a user at the keyboard, and in turn passes the entered value to two methods. One converts the value from inches to feet, and the other converts the same value from inches to yards. Each method displays the results with appropriate explanation.
Computers and Technology
1 answer:
Dafna1 [17]3 years ago
7 0

Answer:

import java.util.Scanner;

public class InchConversion

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

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

 double inches = input.nextDouble();

 

 inchesToFeet(inches);

 inchesToYards(inches);

}

public static void inchesToFeet(double inches){

    double feet = inches / 12;

    System.out.println(inches + " inches = " + feet + " feet");

}

public static void inchesToYards(double inches){

    double yards = inches / 36;

    System.out.println(inches + " inches = " + yards + " yards");

}

}

Explanation:

In the inchesToFeet() method that takes one parameter, inches:

Convert the inches to feet using the conversion rate, divide inches by 12

Print the feet

In the inchesToYards() method that takes one parameter, inches:

Convert the inches to yards using the conversion rate, divide inches by 36

Print the yards

In the main:

Ask the user to enter the inches

Call the inchesToFeet() and inchesToYards() methods passing the inches as parameter for each method

You might be interested in
Ken is a mobile app developer. He is designing a mobile app that offers tips and guidance to people interested in learning jazz
Luden [163]

Answer:

D is the one that makes the most sense

3 0
3 years ago
Read 2 more answers
True or False <br><br> Rootkits are only made by black-hat hackers.
Kipish [7]
True rookies are only made by black hat hackers I am not sure I hope this will help
4 0
3 years ago
Who invent cars and who invent bikes and who invent pc
julia-pushkina [17]

Answer:

  • Cars were invented in 1886 by Karl Benz.
  • The term bicycle was coined in France in the 1860s, but The first verifiable claim for a practically used bicycle belongs to German Baron Karl von Drais in 1817
  • The first computer was by Charles Babbage, an English mechanical engineer and polymath he originated the concept of a programmable computer.

7 0
3 years ago
Each device attached to your computer has a special program called a(n ________ that enables the device and operating system to
koban [17]
The answer is Device Driver
8 0
3 years ago
Viết chương trình nhập vào họ tên của bạn rồi in nội dung chuỗi đó lên màn hình.Ví dụ:Nếu họ tên nhập vào là: NGUYEN BINH MINH t
muminat
Why people spam this nugen thing
7 0
3 years ago
Other questions:
  • What cable should i be using to connect my android tablet to the pc?
    13·2 answers
  • Which partitioning method must be used for partitioning a 4-tb hard drive?
    6·1 answer
  • How do you make your graphics ADA accessible in BlueGriffon?
    12·2 answers
  • Respecting yourself and others, educating yourself and connecting with others, and protecting yourself and others are all aspect
    11·1 answer
  • Hands-On Project 15-4 Make Network Cables
    8·1 answer
  • Which type of weathering creates karst topography?
    5·1 answer
  • PLS HURRY!!<br> Look at the image below!
    7·1 answer
  • You have one IP address provided from your ISP with a /30 mask. However, you have 300 users that need to access the Internet. Wh
    10·1 answer
  • Do you know the energy unit question?
    10·1 answer
  • Is data science the sexiest job in 21st century according to Harvard business review?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!