Question: **** Done in Java. Any help is appreciated because I cannot get the method to work. Will definitely give a thumbs up if you can
**** Done in Java. Any help is appreciated because I cannot get the method to work. Will definitely give a thumbs up if you can help. ****
// Use a Scanner to reads a number between 1000 and 1 Trillion and print it with commas (,) separating // every three digits. for example: 12317910.67 will be printed as $12,317,910.67 // You MUST use divide and/or modulus operators and may save part of the number, then concatenate back // together as a String // You must use printf to print the combined string and everything else in this method. // Question: There is an easier way to print a number with commas (,) separating every 3 digits without // doing all the computations with %. What is it? Answer: Use printf .... How? write the code that will do it.
public static String addCommas(double usrNumber) { //TODO
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
