CJCoding With Joseph
15free / daySign inCreate account

Use Java's NumberFormat class to read a decimal ratio and print it as a percentage with exactly one decimal place.

Create a percent formatter with NumberFormat.getPercentInstance(), then set both min and max fraction digits to 1. The formatter multiplies your decimal by 100 and appends % automatically.

⚠️ AUTO-INPUT MODE: The input stream will automatically contain '0.375\n'. Use Scanner's nextDouble() to read it - no keyboard input is needed.

Expected output

Rate: 37.5%

= newline. The output ends with a newline, so print one after the last line.

Hints4 available
Topics
Miscellaneous
Auto-input
0.375\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.