Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CSCE 2 4 0 Programming Assignment One Due: 1 1 : 5 9 pm on Wednesday, January 2 4 th Program Purpose Compute a 3
CSCE Programming Assignment One
Due: :pm on Wednesday, January th
Program Purpose Compute a 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 endofday balance for the day period
starting from the beginning balance date.
The users first entry will be in the format mdyyyy numericbalance
Assume that the input will be in the correct format.
Each subsequent entry will be in the format
debitorcreditindicator mdyyyy value
The debit or credit indicator will be either d for debit, c for credit, or q to
quit
eg d
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.
Outoforderentrydate entered after previousentrydate
The program will accept entries until the user inputs an entry date thats more
than days after the beginning balance date, or the user enters q for the
debitcredit 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 users last transaction date is fewer than 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 $ overdraft fee. Output a message to
the user in the following format informing them of the overdraft date and fee
assessed.
Overdraft on mdyyyy $ overdraft fee assessed.
Note: Your program will need to account for the number of days in the month.
Note: For February, youll need to determine if the year is a leap year.
If a year is divisible by its a leap year
Else, if its divisible by its not a leap year
Else, if its divisible by its a leap year
Else, its not a leap year
Example inputoutput pairs
Example Input:
d
d
c
d
Example Output:
day average balance : $
Example Input:
d
d
d
c
d
Example Output:
day average balance : $
Example Input:
c
c
d
d
c
Example Output:
Overdraft on $ overdraft fee assessed.
day average balance : $
Example Input:
c
d
c
q
Example Output:
day average balance : $
Example Input:
d
d
d
d
c
d
q
Example Output:
Entries must be provided in chronological order.
entered after
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 programcc
Submit your programcc 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.
Programs must compile and run on a computer of the instructors choosing in
the Linux lab see your course syllabus for additional details
Be sure to review the program expectations section of the course syllabus.
Initial Testing
Initial tests for the functions are attached to the assignment in Blackboard. A
makefile has been included to run your functions with the sample tests. In order
to use the makefile, ensure that your programcc file and all of the files
attached to the assignment are in the same directory. Your program will be
graded using this same method with modified tests.
The commands to run the sample tests are given below:
make test
make test
make test
make test
make test
make test
make test
You are strongly encouraged to create additional, more rigorous tests.
Grade Breakdown
Style: point
Documentation: point
Clean compilelink of programcc: point
Runs correctly with instructors test input : point
Runs correctly with instructors test input : point
Runs correctly with instructors test input : point
Runs correctly with instructors test input : point
Runs correctly with instructors test input
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started