Question: Exerc Use IPython sessions for each exercise where practical. (Check Protection) Although electronic deposit has become extremely popular, tentional alteration of a check amount
Exerc Use IPython sessions for each exercise where practical. (Check Protection) Although electronic deposit has become extremely popular, tentional alteration of a check amount by someone who plans to cash a check fraudulently. payroll and accounts payable applications often print checks. A serious problem is the in- To prevent a dollar amount from being altered, some computerized check-writing systems ically contain a fixed number of spaces for the printed amount. Suppose a paycheck con- a blanka spaces tains eight paycheck. If the amount is large, then all eight of the s in which the computer is supposed to print the amount of a weekly spaces will be filled: 1,230.60 (check amount) 01234567 (position numbers) On the other hand, if the amount is smaller, then several of the spaces would ordinarily be left blank. For example, 399.87 the Exercises 01234567 contains two blank spaces. If a check is printed with blank spaces, it's easier for someone to alter the amount. Check-writing systems often insert leading asterisks to prevent alter- ation and protect amount as follows: **399.87 313 01234567 Write a script that inputs a dollar amount, then prints the amount in check-pro- tected format in a field of 10 characters with leading asterisks if necessary. [Hint: In a for- mat string that explicitly specifies alignment with , you can precede the alignment specifier with the fill character of your choice.]
Step by Step Solution
There are 3 Steps involved in it
Program code screenshot Sample Output ... View full answer
Get step-by-step solutions from verified subject matter experts
