You are implementing a brand new type of ATM that provides exact amounts of cash (bills only, no coins). In order to maximize potential revenue an algorithm is needed that will allow for using different denomination amounts as needed by the local currency (value of bills will vary, but are integers)
1. The program shall graphically prompt the user for a file.
2. The program shall read the selected file of which the first line will be a space separated list of the bill denomination sizes.
3. The program shall then read each line in the rest of the file containing an integer and output the number of different ways to produce that value using the denominations listed in the first line.
4. The program shall indicate after that the number the number of milliseconds the program spent calculating the answer.
5. The program shall implement 2 different forms of the algorithm: 1 recursive and 1 using dynamic programming.
6. The program shall have 2 sets of output, 1 for each implementation.
7. The program shall write the output to a file in the same directory as the input file.
8. It should have Error handling, input checking.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.JFileChooser;

* @author
public class ATM {

    public static void main(String[] args) {
       // The program shall graphically prompt the user for a file.
       JFileChooser fc = new JFileChooser();
       int result = fc.showOpenDialog(null);

       if (result != JFileChooser.APPROVE_OPTION) {
       File input = fc.getSelectedFile();

       try {

       } catch (Exception e) {

    private static void run(File file) throws FileNotFoundException {
       int number;
       long start, recursiveTime, dpTime;
       int recursiveCounter...

By purchasing this solution you'll be able to access the following files: and input.txt.

for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Computer Science - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats