A simple C++ program that reads data from two text files - payments.txt
and people.txt
- and outputs itemized purchase statements for each person, including their total spending.
- Reads payment records (
name item price
) frompayments.txt
- Reads a list of people from
people.txt
- Generates a statement for each person showing their purchases and total
- Validates input and reports errors for missing or invalid data
Bob
eggs 2.5
pen 3.5
Total: 6
Alice
apple 1.5
eggs 2
Total: 3.5