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]
2 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]2 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
What is the purpose behind the Three Phase Commit? It improves upon the two phased commit by requiring that locks be acquired at
Ray Of Light [21]
The answer is a) It improves upon the two-phased commit by requiring that locks be acquired at the start of a transaction.

Reason: The 3PC is an extension or you can say developed from 2PC that avoids blocking of an operation. It just ensures that first n sites have intended to commit a transaction that means it acquires commits or locks before the start of any transaction to avoid any blocking.

Option b) is wrong as it does not allow coordination, it just let all the other sites do their transaction if any other site is blocked, so no coordination is there between sites that they will wait till their coordinator is corrected.

Option c) is wrong as lock operations are shared between other connections as when their coordinator fails, the new coordinator agrees to the old coordinator that they had shared locks before and they can start their transaction.

Option d) is wrong as option a) is correct.

If you like the answer, please upvote.
4 0
2 years ago
Which best describes how computer simulations are used in science?
xz_007 [3.2K]
Computer simulation is just like training for example before pilot fly plane they got training from computer simulation it's just like video lecture
5 0
2 years ago
What type of internet connection do you think you'd get in Antarctica?
rusak2 [61]
Hello!
My best guess is you would have to use mediocre satellites that float over for internet connection.
3 0
3 years ago
Read 2 more answers
Which type of software is created on user dimension​
Ratling [72]

Answer:

Application and system software is created on user dimension.

6 0
2 years ago
What is the definition of a client computer?
kozerog [31]

<u>Client computer:</u>

A customer is a bit of PC equipment or programming that gets to assistance made accessible by a server. The server is frequently (yet not generally) on another PC framework, wherein case the customer gets to the administration by method for a system.

A gathering of customers is generally called a customer framework. The individuals from a customer framework are normally identified with each other in at least one perspective. The customer is likewise another name for a product program used to associate with a server. 3. A customer can likewise be another term used to depict a client.

5 0
3 years ago
Other questions:
  • 1. What arguments can you make for the idea of a single language for all programming domains
    10·1 answer
  • On an Android device, where can a user find the correct app to use to sync contacts and apps among devices?
    10·1 answer
  • What was one of the first inventions that made it possible to communicate almost instantly?
    11·1 answer
  • It is good practice, however, for policy _________________________ to solicit input both from technically adept information secu
    7·1 answer
  • a user has a large amount of data that she or he needs to store. the data will not be accessed regularly, but still needs to be
    5·2 answers
  • When parallel parking, you should select a space that is __________ as long as your car.
    11·1 answer
  • I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
    13·1 answer
  • The computer virus is simply a.......... a. diseases b.set of computer instrustruction or code c. types of bacteria​
    9·1 answer
  • 2 4.1.2 Quiz: Information Systems and Business Planning
    11·1 answer
  • What is the difference between DWT and CWT?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!