Question: Create a Java class that will allow the user to input floating point value representing the current temperature. Demonstrate the use of DecimalFormat, System.out.printf() and
Create a Java class that will allow the user to input floating point value representing the current temperature. Demonstrate the use of DecimalFormat, System.out.printf() and String.format() to output the temperature with 2 decimal places. In the sample run you will see 3 outputs that look exactly alike - you are being assessed on using the 3 methods for output above. A sample run of this program might look like this (user input is in red): Enter the current temperature: 25.4 The current temperature is: 25.40 The current temperature is: 25.40 The current temperature is: 25.40
----------------------------------------
please use simple java it's the first java class. thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
