Program 3ad For What To Do

Program 3ad For What To Dodocxprogram 3checkdatatxt1678jane Do

Program 3checkdata.txt 1678 Jane Doe 4/28/09 567.12 George Obama 5/1/10 811.47 Barrak Bush 10/19/10 98.14 Condi Clinton 12/31/09 1.84 Hillary Rice 7/3/10 0.56 Jen Fuller 8/25/09 112.13 Abe Washington 3/2/11 117.00 George Lincoln 2/9/09 345.99 Nick Lidstrom 11/23/09 10.00 Steve Yyzerman 12/23/09 9.97 Program 3/READ FOR WHAT TO DO.docx Write a C++ program to write checks. Your program should read and process data from an input file (filename checkdata.txt) Each line of the file includes data on a person to whom a check will be written by Delta College. The first line of the data file includes the starting check number. The input file begins similarly to what you see below: 1678 Jane Doe 4/28/09 567.12 George Obama 5/1/10 811.47 Barrak Bush 10/19/10 98.14 ... and so on ... Your program will of course not direct output to a check-writing device. Instead, simulate the look-and-feel of a check with line and character spacing. An example of what your output could look like is: --------------------------------------------------------- PAY TO THE ORDER OF: Jane Doe $ 567.12 FIVE HUNDRED SIXTY-SEVEN AND 12/100 DOLLARS Delta College --------------------------------------------------------- PAY TO THE ORDER OF: George Obama $ 811.47 EIGHT HUNDRED ELEVEN AND 47/100 DOLLARS Delta College --------------------------------------------------------- PAY TO THE ORDER OF: Barrak Bush $ 98.14 NINETY EIGHT AND 14/100 DOLLARS Delta College --------------------------------------------------------- Create a class to manage information and actions for one check recipient. Data members for your class will include all of the relevant information for the check and recipient. Be sure that one member function included is the action of writing the actual check. Otherwise, design the class to your own style. The driver program must write checks for all lines of input data in the file. For this, feel free to re-use one object of your 'check' class, or you may create an array of objects of this class. The check number should advance for each new check that is to be written. After processing and writing your last check, add one more output statement that identifies the starting check number for the next batch of checks that would be printed in the future. MAKE SURE YOU USE COMMENTS EXPLAINING WHAT YOU ARE DOING Deliverables Deliver the following as your final product: · Cover page with assignment name, student name, and list of attachments · Printed copy of source code · Printed Output of checks using provided file

Paper For Above instruction

Program 3ad For What To Dodocxprogram 3checkdatatxt1678jane Do

Program 3ad For What To Dodocxprogram 3checkdatatxt1678jane Do

This assignment involves creating a C++ program that reads data from a text file to simulate printing checks. The program will implement an object-oriented approach by defining a class that encapsulates all relevant information about each check recipient and provides functionality to produce a formatted check output. The input data file begins with a line containing the initial check number, followed by multiple lines, each with recipient information: name, date, and amount.

Design and Approach

The primary task involves designing a class, which we will call Check, to manage individual check details. Data members for this class include the recipient's name, date, amount, and check number. Key member functions will include methods to process the data and output a formatted check resembling actual check appearance, with appropriate spacing, font-like spacing, and wording for amounts in words.

Implementation Details

The C++ program will perform the following steps:

  1. Open and read from the input file checkdata.txt
  2. Read the first line for the starting check number
  3. Iterate through each subsequent line to extract recipient data: name, date, and amount
  4. Create an instance of the Check class for each recipient, updating the check number each time
  5. Call the class method to output a simulated check with aligned spacing and wording
  6. After processing all entries, output a line indicating the next check number for future use

Class Design

The Check class includes:

  • Data Members: recipient's name, date, amount, check number
  • Member Functions:
    • Constructor to initialize data members
    • writeCheck() to display the check with formatted output, including amount in words

Amount in Words Conversion

A critical part of the program is converting the numerical amount into words, including handling dollars and cents in a typical check format. The conversion involves dividing dollars and cents, then mapping digits to word equivalents, and constructing a complete amount in words (e.g., "FIVE HUNDRED SIXTY-SEVEN AND 12/100 DOLLARS").

Sample Output

The resulting output for each check should resemble:

---------------------------------------------------------

PAY TO THE ORDER OF: Jane Doe $ 567.12

FIVE HUNDRED SIXTY-SEVEN AND 12/100 DOLLARS

Delta College

---------------------------------------------------------

This output mimics an actual check, with proper formatting, spacing, and wording.

Conclusion

By designing an appropriately structured class and carefully generating the formatted output, the program will provide a realistic simulation of check printing based on input data. Attention to detail in amount conversion and spacing will be essential for producing professional-looking checks. Proper commenting throughout the source code will clarify the purpose of each section, making the program understandable and maintainable.

References

  • McConnell, S. (2020). C++ Programming: From Problem Analysis to Program Design. McGraw-Hill.
  • Stroustrup, B. (2013). The C++ Programming Language. Addison-Wesley.
  • Gaddis, T. (2018). Starting Out with C++: From control structures through objects. Pearson.
  • Deitel, P., & Deitel, H. (2017). C++ How to Program. Pearson.
  • ISO/IEC (2017). C++ Language Standard (ISO/IEC 14882:2017).
  • https://www.geeksforgeeks.org/convert-numeric-amount-to-words-in-cpp/
  • https://www.codeproject.com/Articles/24452/Number-to-words-in-C
  • https://www.programiz.com/cpp-programming/examples/number-to-words
  • https://www.cplusplus.com/doc/tutorial/
  • https://www.tutorialspoint.com/cplusplus/cpp_number_in_words.htm