prog02 - Name George Corser Program CSC 375 Program...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//------------------------------------------------------------------------ // Name: George Corser // Program: CSC 375 Program 2 (Prog02.cpp) // Due Date: 03/02/2009 // Compiler: Bloodshed Dev-C++ // // Comments: GREEDY ALGORITHM - USING LINKED LIST STRUCTURE // This program calculates and prints out the minimum number // of currency denominations required to provide various // dollar amounts in cash. Specifically, it: // * Populates a list structure of currency denominations // * Reads an input file of dollar amounts, and for each amount, // tabulates and prints the minimum number of bills and coins // required to provide the amount in cash (note: the code // ignores blank input lines and lines containing all zeroes) // * Prints a summary of the number of times each denomination // was used // // Variables (VARIABLE DICTIONARY): // pFile - pointer to the input file // argc - number of command line arguments // argv - character array of command line arguments // currenttext - text of the current line of the input file // currentamount - numeric value of currenttext // cashremainder - money remaining to be divided into denominations // cashcount - number of uses of a particular currency denomination // darray[] - array of (double precision) currency denominations // // root - pointer to the first (header) node in the linked list // conductor - pointer of the current node in the linked list // (used for traversing the list) // // Variables from the linked list structure (link1.h): // node - structure for the linked list of currency denominations
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/19/2010 for the course CSC 375 taught by Professor Turner during the Spring '09 term at University of Michigan-Dearborn.

Page1 / 3

prog02 - Name George Corser Program CSC 375 Program...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online