Question
There are 12 inches in a foot and 3 feet in a yard . Create a class named InchConversion. Its main() method accepts a value
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 inches 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.
This is what is given:
import java.util.Scanner;
public class InchConversion
{
public static void main (String args[])
{
// Write your code here
}
public static void convertToFeet(int inches)
{
// Write your code here
}
public static void convertToYards(int inches)
{
// Write your code here
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started