<p>Design the output and draw a flowchart or write pseudocode for a program that
ID: 3626790 • Letter: #
Question
<p>Design the output and draw a flowchart or write pseudocode for a program that<br />calculates the service charge a customer owes for writing a bad check. The program accepts a customer’s name, the date the check was written (year, month, and<br />day), the current date (year, month, and day), and the amount of the check in dollars and cents. The program continues until an eof value is encountered. The service charge is $20 plus 2 percent of the amount of the check, plus $5 for every month<br />that has passed since the check was written. A check is one month late as soon as a<br />new month starts—so a bad check written on September 30 is one month overdue<br />on October 1</p>Explanation / Answer
1.Load the file 2.Read and store check_date_month in a variable 3.Read and store current_date_month in a variable 4.Read and store check_amount in a variable 5.Service_charge = 20 + 0.02*(check_amount) + [(current_month - check_date_month) + current_date_year - check_date_year]*5 6.Read customer's name and show to the user something like: "Customer's Name" Service charge: "$"Service_charge The days in this case are not relevant because the charge increases every time the month changes, so, in the case we are in October and the check was done in September (10-9 = 1) we have to pay $5 more, but maybe we could be in different years, for example 2010 and 2009, that means that between October and September there are now (1 + 12 = 13) months, so now you have to pay $65. I expect this will help you to understand step 5.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.