Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi this program must be completed using a Eclipes Compiler for Java only . This is and intro to java class , so only intro

Hi this program must be completed using a Eclipes Compiler for Java only .
This is and intro to java class , so only intro methods should be used for this assignment.
Please include a copy of the input data and a sample of the out put data .
Thanks a bunch
image text in transcribed
Homework-Topic 9-Donations Write a complete program to do the following: The main program calls a method to read in (Erom an input file) a set of people's three-digit ID numbers and their donations to a charity (hint: use parallel arrays)Then the main pzogran calls a method to sort the ID numbers into numerical order, being sure to carry along the corresponding donations. The main progzan then calls a method to print the sorted lists in tabular form, giving both ID numbers and donations. Then the main program calls another method to sort the donation amounts into ascending order, carrying along the corresponding ID numbers.It then, once again, prints the sorted lists. giving both ID numbers and donations Here are the details: (a) The main program calls a sethod to read in the data from a file The data consists of sets of data, eachf which contains a person's three-digit ID number and an integer (e- 456 20000 or 123 30234). The file is read until end-of-file is reached- The method returns hw many sets of data we re read in. Th donorcount e main progzam calls the return value The main program calls these arrays idnumbers and donations A separate printing method prints the original set of data in the form of a neat table. When the arrays print, there should be an overall heading, plus headings for the columns of ID nunbers and donations (b) Then the main program sends the array of ID numbers. the array of donations. and the size donorcount to a sorting method. This method sorts the ID numbers into numerical order Be sure to maintain the mateh-up of ID numbers and donations For example456 should always be associated with 20000, no matter where 456 oves in numerical order; similarly, 123 should stay with 30234 When the sorting method finishes and returns control to the main program, the main program calls the printing method to once again print the two arrays c) Next, the main program sends the sane three parameters to the second sorting method, which sorts the donations into numerical order, being sure to maintain the linkup of ID numbers and donations When this sorting method finishes and returns control to the main program, the main program, once again, calls the printing method to print the two arrays with appropriate headings Your arrays should have room for up to 50 entries. To test the program, have a set of data with at least 15 to 20 values in each array. Make sure that your original order in not close to numerical order for either array and that the two numerical orders are not close to each other

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions