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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!