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
write a function that given an integer n returns the smallest integer greater than n the sume of whose digits is twice as big th
USPshnik [31]

The code below is written in javascript which gives us the integer,

<h3>The function code is</h3>

function solution (num){


//Javascript function


var x=0,sum=0,a,b;


var d=""; //variable declaration


var digits = num.toString().split('');


var Individual = digits.map(Number);


//console.log(Individual);


for (var i=0;i<Individual.length;i++)


{//For loop


x=x+Individual[i];


}


var y=x*2;


for(var i=0;i<Individual.length;i++)


{


sum=sum+Individual[i];


d=""+d+Individual[i];


if(sum==y)


break;


if(i==Individual.length-1)


{


i=-1;


continue;


}


}


console.log("the value is "+d);


}


var number = prompt("enter the number");


//Asking user for value...


console.log("the number is");


console.log(number);


solution(num

For more information on javascript, visit

brainly.com/question/16698901?referrer=searchResults

3 0
2 years ago
What happens when you press the Enter key at the end of a line of bulleted text?
sladkih [1.3K]

i think the  answer is d

6 0
3 years ago
Read 2 more answers
In 1972, earlier designers built the
Sonbull [250]

The exercise is about filling in the gaps and is related to the History of the ARPANET.

<h3>What is the History of the ARPANET?</h3>

From the text:

In 1972, earlier designers built the <u>ARPANET </u>connecting major universities. They broke communication into smaller chunks, or <u>packets </u>and sent them on a first-come, first-serve basis. The limit to the number of bytes of data that can be moved is called line capacity, or <u>bandwidth</u>.

When a network is met its capacity the user experiences <u>unwanted pauses</u>. When the network is "slowing down", what is happening is users are waiting for their packet to leave the <u>queue</u>.

To make the queues smaller, developers created <u>mixed </u>packets to move <u>simultaneously</u>.

Learn more about the ARPANET at:
brainly.com/question/16433876

7 0
2 years ago
Explain how a touris could use QR codes at an airport to help plan a holiday
elena55 [62]

Answer:

with tech

Explanation:

8 0
3 years ago
I have tried many times to find a gaming setup for $4k. I have tried many websites but they are not working for my liking. Any o
Vikentia [17]
I would try going to pcpartpicker.com and build your pc from there, and after you’ve done that take your remaining budget to find whatever else you need for your setup
8 0
2 years ago
Other questions:
  • Complete the following:_____
    9·1 answer
  • A user states that when they power on their computer, they receive a "Non-bootable drive" error. The user works with external st
    8·1 answer
  • Token stories of success and upward mobility (illustrated by Oprah, Ross Perot, and Madonna) reinforce ________ and perpetuate t
    8·1 answer
  • For each of these statements find a domain for which the statement is true and a domain for which the statement is false. a) Eve
    13·1 answer
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
    12·1 answer
  • 2.1. The stream cipher described in Definition 2.1.1 can easily be generalized to work in alphabets other than the binary one. F
    10·1 answer
  • In the URL, what is the subdomain and what is the domain name?
    5·1 answer
  • Kevin needs to get his data from a database into a text file to send to another group. He needs to _____.
    12·2 answers
  • Siapa mahapatih brainly.com atau yg disebut Brainly Amerika Serikat ?​
    5·1 answer
  • What is data analysing data and give three examples ?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!