Question: import java.util.Scanner; public class Methods { public static void main ( String [ ] args ) { / / Declare and instantiate a Scanner Scanner
import java.util.Scanner;
public class Methods
public static void mainString args
Declare and instantiate a Scanner
Scanner scnr new ScannerSystemin;
Continue serving method selection menu
until "Exit" option is selected
int selection;
do
System.out.print
Method Selection Menu
Temperature Conversion Fahrenheit to Celsius
Distance Conversion Yards to Feet and Inches
Get Acronym
Triangle Generator
Exit
"Enter selection : ;
try
selection Integer.parseIntscnrnext;
catchNumberFormatException ex
selection ;
switch selection
case :
doTempConversionscnr;
break;
case :
doDistConversionscnr;
break;
case :
flush input buffer
if scnrhasNextLine
scnrnextLine;
doGetAcronymscnr;
break;
case :
doTrianglescnr;
break;
case :
System.out.printlnExiting;
break;
default:
System.out.printlnError: Invalid option";
while selection ;
scnrclose;
end of main method
public static void doTempConversionScanner scnr
TODO: Remove placeholder message
System.out.printlnNot yet implemented.";
Below this comment: declare any other variables you may need
to store the user's input and the Celsius equivalent value
fareinheitToCelsius
Below this comment: prompt the user to enter the required inputs
Below this comment: collect the required inputs from the user
System.out.printlnEnter temperature in Fareinheit : ;
fareinheit scnrnextDouble;
Below this comment: call your fahrenheitToCelsius method
celsius fareinheitToCelsius farenheit;
Below this comment: display the required results
System.out.printlnf degrees Farenheit is f Celsius
farenheit, celsius;
public static double fareinheitToCelsiusdouble
double c
define your fahrenheitToCelsius method here below
public static void doDistConversionScanner scnr
TODO: Remove placeholder message
System.out.printlnNot yet implemented.";
Below this comment: declare any other variables you may need
to store the user's input and the Feet and Inches equivalent value
double yards;
String feetandInches;
Below this comment: collect the required inputs
System.out.println Enter the distance in yards";
yards scnrnextDouble;
Below this comment: call your yardsToFeetAndInches method
feetandInches yardToFeetAndInchesyards;
Below this comment: disply the required results
System.out.printlnf yards in feet and Inches is :n yards, feetandInches;
define your yardsToFeetAndInches method here below
public static String yardToFeetAndInchesdouble y;
double totalInches y;
int feet int totalInches;
return String.formatdf feet, inches
public static void doGetAcronymScanner scnr
TODO: Remove placeholder message
System.out.printlnNot yet implemented.";
Below this comment: declare and instantiate a Scanner
Scanner scanner new ScannerSystemin;
Below this comment: declare any other variables you may need
String scorewords;
String acronyms;
Below this comment: collect the required inputs
System.out.printlnEnter some words : ;
scorewords scnrnextLine;
Below this comment: call your required method
acronyms getAcronymscorewords;
Below this comment: disply the required results
System.out.printlnAcronym is s : s
scorewords, acronym;
define your getAcronym method here below
public static String getAcronymsString words
String acronyms words.substringbeginindex:endIndex:;
int space words.indexOf;
whilespaceIndex
acronym words.substringspaceIndex spaceIndex;
spaceIndex words.indexOf spaceIndex;
return null.toUpperCase;
public static void doTriangleScanner scnr
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
