SOLVED: Console program that repeatedly prompts the user to enter data until they type done 

25.00 $

Category: Tags: , , , , , , , , , , , , , ,
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: rar solution files instantly, after Payment

Securely Powered by: Secure Checkout Second Badge

Description

5/5 - (2 votes)

Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two-dimension array where the first dimension contains exactly what they type and the second dimension contains the first non-whitespace character of what they type, in lowercase. If they enter a blank line, it is acceptable to skip that line. When they type done, do these steps:
display: As Entered or each entry in the array, display the index of the first dimension, the second dimension’s value, and the first dimension’s value on a single line separated by : (colon).
display: Bubble Sorted
using a bubble sort, for each entry in the array, display the original index of the first dimension, the second dimension’s value, and the first dimension’s value on a single line separated by : (colon) sorted by the second dimension.
display: Selection Sorted
using a selection sort, for each entry in the array, display the original index of the first dimension, the second dimension’s value, and the first dimension’s value on a single line separated by : (colon) sorted by the first dimension.
Grading Notes:
Please read the instructions carefully! Using the wrong sort or dimension will hurt your grade!
The instructor will attempt to crash your program — an exception will cost you 10 points — don’t let exceptions happen!
If you ensure that duplicate values are sorted with the lower original array index first, you will get 5 extra points (final score not over 100).
You can use the sort methods from the book, but you will get 5 extra points if you do them as inner classes and FULLY comment them.
Example:
User types:
apple
Apple
Zone
apple
done
You display:
As entered
0:a:apple
1:a:Apple
2:z:Zone
3:a:apple
Bubble Sorted
0:a:apple
1:a:Apple
3:a:apple
2:z:Zone
Selection Sorted
1:a:Apple
0:a:apple
3:a:apple
2:z:Zone
0

  • ArrayDataSort.rar