The example of this article tells the method of rewarding the amount of digital writing in Java. Share it for everyone for your reference. The specifics are as follows:
Example: Implement the form of the amount of Arabic numerals into a Chinese uppercase amount, such as::
¥ 1011 → One yuan and one yuan.
The uppercase numbers are: zero, one, 贰, three, three, wild, Wu, Lu, 柒, 捌, 玖, Pic, Pic, 10,000, 100 million
Import java.io.*; Import java.lang.string; Public Class Change {Public Static void Main (String Agrs []) {// Money used to store the amount of inputs loong money = 0; string mon [ ] = { "Zero", "one", "贰", "three", "肆", "Wu", "Lu", "柒", "玖", "玖"}; string mon1 [] = {"pick" , "Bai", "Thousands", "Wan", "Picking Wan", "Million", "million", "billion", "Picky 100 billion", "10 billion", "100 billion"}, je [ ] = new string [30]; // je [] array is used to store numbers after the number of numbers is converted. .out.println ("Please enter the amount you need to convert:"); // Convert the input amount to a long type of data else {money = long.parselong (agrs [n-1]); Stay the number of numbers that need to be converted, int bitt = 0, j, k = -1, i = 0; // The conversion process while (money! = 0) {bitt = (int) (money%10L); / /Calculate the uppercase value for each number for (j = 0; j <mon.length; j ++) {if (j == Bitt) break;} // Save the corresponding value into the IF (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k (k ! =-1) {je [i] = mon1 [k]; i ++;} je [i] = mon [j]; i ++; money = money/10; k ++; if (money == 0) {// output System.out.print after conversion ("" The amount you entered is: "); i-; for (;; i> = 0; i-) System.out.print (je [i]);}}}}}}}}}} }}It is hoped that this article is helpful to everyone's Java program design.