Question: Please create a graphical java solution to solve the problem found below: Your fellow worker receives files that are very poorly formatted and is hopping

Please create a graphical java solution to solve the problem found below:

Your fellow worker receives files that are very poorly formatted and is hopping that you could help. Each of these files contain a series of floating point numbers that are very tough to read. Here is a sample file (random.txt).

4.860 312.570 16.86488 37.74840755 32.19799077 19.5409 354.316313847 84.932 5.0 1.1044 23679.0186 423.149128489 0.634084262 0.877 162.298 1 30.4 1.70866391 3.40641591 552 23.24 660.634 793.56811208 801.801960.609334346 0.81815 354.269749312 7 532 7.1 460.26 4.037 1.55519442 0.941 539.527588137 8.734942 11 27.83 5.15152 8.5656 2.081 453.04819893 0.35 748.381528752413.712968 5.60 0.13801398 0.293 66.72401 1.55284 50.1001 0.49440 0.972 762.960 7.50.26515 50.6467265 919.528924 2.6481 12.04972 0.733090 7.071 117.813352547 0.99 0.3254 559.34965 0.8840721 32.7056337 39.54641 61.922 8.15829916 55.34064397 0.081894 76.861 4.17 90.864039 962.9340 72.12223 0.382 0.913125 4.6 4.0115 633.459 8.1031448 0.62 2.098837 8.783 89.87463254 842.88 981.24058 701.057344 970.615332 26.252 0.1 0.713 85.5450473 5.61 846.9321 680.2426143 7 24.01892678 7.84 87.5711 0.68 35.00 0.0 103.32235 76 0.188 0.95284967 989.693026975 29.178994 7.553 0.2540188 15 29.0 98.3 7 0.81 9.16652634 5.57604241 871.392859028 0.2158557 4 18.78 64.4581 83.8 601.585 0.1194 6.352860 81.572139 6.07016 54.7576 0.39607207 0.88 893.7953 92.957162685 0.195339 2 471.9811160 383.633876120 832.62970 84.95497 655.27437121 0.12 81.509 21.8074325 0.6 9.565661407 8.496138416 9.6 34.02089 0.943 87.95114 8.448 0135.78079 8.2538465 715 28 776.738 7.7659837 8.20641 63.4940285 956.2561 623 9.10 792.1877412 9 0 7.903936799 9.8331 894.55450 367.6118 7 1 401.047 29.9529064 0.9461664 39.8551137 2.759544 564 0.77686627 70.580092599 0.1345248 32.0759 1 4.0 0 32.780303 0.6 1.951 765.52030 5.947732968 9.4556072 0.260 790.6685 0.848 43.950585 318.434080229 20.4 0.51687038 7.8431 0.827 9.024681870 715.8 0.6831 218 410.884 372 94.8 30.32980 3 0.4522 317 0.70040250.422.357477276 91.6 0.5904 1.88 703.94 32.67214217 188.8826 0 0.411973 1.91970226.2391 23.53865557 65.335617 140.1 0.8195 624.0766194 32.95 75.4292140 762.037314 4.501 0.69680 941 79.3910306 55.53741011 7.721 8 0.2524428 0.162 69.166149587 0.07 3.52652 0.358066 0.01 94.4 0.615 917.4579 0.3 993.56 0.9815387 297.1615681 0.038 17.556 3.28907 20.85 0.39 0.47780946471.505 6.399 71.8067 312.642 0.0284510.5779773 5.281 49.36711260.6496 4.5845628 0.22605 26.72330366 0.363 0.565637515 3.86 819.4 30.3 0.695 0.387188 72.14666 0.462498102 39.5633 702.6450980 208.367538579 52.404 1 95.24140 0.36 7.34734 548.2 54.018 251.97044 5.42490 168.956528233 0.3 19.32 99.22 61.00226020 30.8 448 7.286 524.40273 0.381398923 84.7825562 0 4.84 9 3.51309 0.9690 30.6794266 183 831.85167107 9.1 8.02657326 9 3.77 0.54642131 795.68797 4 68.11890 414.40854674 8.389027 0.889679 512.2 2.9526 6.112830.39 24.557281 0.4136 60.93584992 5.53693170 90.1389 0.872875035 66 0.6639258 91.402670867 67.954284928 22.323149757 993.0100381 5.05763 5.109763084 469.2499835 0.8214130 429.52312 807.8 739.77008 58 3.0 859.581006 0.301568278 261.82 139 0.294858 5.334915 72 696.4242 78.71509 0.252375 0.00748 2.5 0.8428788 0.3208689 73.6 1.9894322 250.12 715.92 331.45898 518.62 1 9.7613272 9.468675 419.44543 0.595087726 3.90 26.2 286 1 8.69678 0.6002 98.78475 0.907007567 373.742368 636.65210317 0.1698

Your task is to process all the numbers in the original file and create a new file that is much easier to read.

The program will need to:

  • get the original file name (with or without path) from the user.
  • specify the output file name (with or without path).
  • allow the user to set the field width and set the precision (after decimal point).
  • allow the user to set how many columns on each line (must be from 1 to 5)

The new file must not be created until:

  • the input file actually exists.
  • the destination file does not exist (don't overwrite any file).
  • the field width is specified
  • the precision is specified
  • the number of columns is in the range of 1 to 5.

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!