Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program Purpose Compute a 30-day average checking account balance. Program Details The user will enter a date with their beginning checking account balance followed

image text in transcribedimage text in transcribedimage text in transcribed

Program Purpose Compute a 30-day average checking account balance. Program Details The user will enter a date with their beginning checking account balance followed by the dates and values of debits and credits made to the account. The program will calculate the average end-of-day balance for the 30-day period starting from the beginning balance date. The user's first entry will be in the format m/d/yyyy numeric_balance Assume that the input will be in the correct format. Each subsequent entry will be in the format debit_or_credit_indicator m/d/yyyy value The debit or credit indicator will be either d for debit, c for credit, or q to quit e.g. d 1/12/2024 12.36 Assume that all input will be in the correct format and assume that all dates entered are valid dates. All entries must be made in chronological order. If an entry is made out of chronological order, the program should exit and provide an error message in the following format. Entries must be provided in chronological order. Out-of-order-entry-date entered after previous-entry-date The program will accept entries until the user inputs an entry date that's more than 30 days after the beginning balance date, or the user enters q for the debit/credit indicator, or the user enters a date that is out of chronological order. The program will output the date range and the average daily checking balance for that date range. If the user's last transaction date is fewer than 30 days after the beginning balance date, the average daily balance will be computed for the number of days from the beginning balance date through the last input transaction date. If a debit is made with insufficient funds, complete the transaction (subtract the amount from the balance) and assess a $15 overdraft fee. Output a message to the user in the following format informing them of the overdraft date and fee assessed. Overdraft on m/d/yyyy. $15 overdraft fee assessed. Note: Your program will need to account for the number of days in the month. Note: For February, you'll need to determine if the year is a leap year. If a year is divisible by 400, it's a leap year Else, if it's divisible by 100, it's not a leap year Else, if it's divisible by 4, it's a leap year Else, it's not a leap year Example input/output pairs Example Input: 12/1/2023 500 d 12/11/2023 200 d 12/23/2023 100 C 12/28/2023 200 d 12/31/2023 250 Example Output: 30-day average balance (12/1/2023-12/30/2023): $360.00 Example Input: 1/28/2024 100 d 1/28/2024 10 d 2/1/2024 10 d 2/1/2024 30 C 2/17/2024 300.53 d 3/1/2024 8 Example Output: 30-day average balance (1/28/2024-2/26/2024): $155.51 Example Input: 2/16/2024 52 c 2/20/2024 100 C 3/1/2024 15 d 3/11/2024 150 d 3/13/2024 20 C 3/17/2024 100 Example Output: Overdraft on 3/13/2024. $15 overdraft fee assessed. 30-day average balance (2/16/2024-3/16/2024): $112.00 Example Input: 12/20/2023 75 C 12/28/2023 150 d 12/31/2023 222.17 c 1/3/2024 50.18 9 Example Output: 15-day average balance (12/20/2023-1/3/2024): $89.10 Example Input: 11/28/2023 110 d 11/29/2023 10 d 12/1/2023 27.03 d 12/4/2023 13.11 d 12/3/2023 4.19 C 12/6/2023 73.24 d 12/15/2023 9.08 Example Output: Entries must be provided in chronological order. 12/3/2023 entered after 12/4/2023 Additional Specifications - All output should be directed to the standard output device using cout. - All input should be accepted from the standard input device using cin. - Do not prompt for input. All of your source code for the program must be contained in a single file named program1.cc Submit your program1.cc file to the assignment in Blackboard. The only header files that may be included in your code are iostream and iomanip. Files that include other headers will not be eligible for correctness points.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Interpreting Qualitative Data

Authors: David Silverman

5th Edition

1473916631, 9781473916630

Students also viewed these Algorithms questions

Question

Is parallelogram FGHI a rhombus? H I yes E 90 G F

Answered: 1 week ago

Question

Input Area: Output Aree

Answered: 1 week ago