Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Follow the started java code below the directions The starter code contains 2-3 formatting errors; all code (including code beyond the section that
Follow the started java code below the directions
import java.util.Scanner; public class InchesToFeet { public static void main(String[] args) { }| // The 'convert()' method (called here from the main method) does all the //work! convert(); // This method asks the user for total inches and outputs the conversion to // feet and inches. public static void convert() { // Create a new Scanner to read in input from user Scanner scanner = new Scanner(System.in); // Prompt the user and then store their input in 'totalInches' System.out.println("Enter the number of inches: "); int totalInches = scanner.nextInt(); // Convert to feet and inches. // ex. If totalInches is 38, then the output would be: 38 inches is 3 feet, and 2 inches // The variable 'totalInches' is the number of inches the user has entered. // ??? INSERT YOUR CODE HERE } } // scanner.close(); //Close the scanner object.
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