(Check Protection) Computers are frequently employed in check-writing systems, such as payroll and accounts payable applications. There are many strange stories about weekly paychecks being printed (by mistake) for amounts in excess of \(\$ 1\) million. Incorrect amounts are printed by computerized check- writing systems because of human error or machine failure. Systems designers build controls into their systems to prevent such erroneous checks from being issued. Another serious problem is the intentional alteration of a check amount by someone who plans to cash a check fraudulently. To prevent a dollar amount from being altered, some computerized check-writing systems employ a technique called check protection. Checks designed for imprinting by computer contain a fixed number of spaces in which the computer may print an amount. Suppose a paycheck contains eight blank spaces in which the computer is supposed to print the amount of a weckly paycheck. If the amount is large, then all eight of the spaces will be filled. For example, \(1,230.60(\text { check amount })\) 12345678 (position numbers) On the other hand, if the amount is less than \(\$ 1000\), then several of the spaces would ordinarily be left blank. For example, $$\begin{array}{r}99.87 \\\12345678\end{array}$$ contains three blank spaces. If a check is printed with blank spaces, it's easier for someone to alter the amount. To prevent alteration, many check- writing systems insert leading asterisks to protect the amount as follows: ***99.87 \-------- 12345678 Write an application that inputs a dollar amount to be printed on a check, then prints the amount in check-protected format with leading asterisks if necessary. Assume that nine spaces are available for printing the amount.

Short Answer

Expert verified
Calculate the number of spaces the amount occupies, prepend asterisks to fill the remaining spaces out of eight, and output the check-protected amount.

Step by step solution

01

Understand the Exercise

The exercise requires creating a check protection system for printing amounts on checks. The system must add leading asterisks to any amount less than $1000 that would otherwise leave blank spaces on the check. We should consider that there are eight available spaces to print the amount.
02

Input the Dollar Amount

Request an input from the user for the dollar amount that needs to be printed on the check. This amount should be stored in a variable for further processing.
03

Determine the Number of Leading Asterisks

Calculate how many characters the dollar amount occupies, including the dot and decimal places. Subtract this count from eight (the total available spaces) to find the number of asterisks needed.
04

Construct the Protected Check Amount

Create a string that consists of the calculated number of leading asterisks followed by the dollar amount. The combined length of the asterisks and the amount should be equal to eight characters.
05

Output the Check-Protected Amount

Display or print the check-protected amount with leading asterisks to the user or the check printing system.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

Key Concepts

These are the key concepts you need to understand to accurately answer the question.

Computerized Check-Writing
The rise of technology has led to the advent of computerized check-writing, which streamlines the process of creating and issuing checks. This innovative approach replaces traditional handwritten checks, shifting to a system where amounts are printed digitally.

In the context of payroll and accounts payable, computerized check-writing ensures that employees and vendors receive accurate payments in a timely manner. Software receives data inputs, like the dollar amounts for paychecks, calculates deductions or additions if needed, and then prints the final amount on the check. One key advantage is the reduction of human error, as the checks are now less prone to mistakes made during manual entry. Each check is printed with precise alignment and formatting, which not only presents a professional appearance but also enhances the readability of the financial information.
Check Fraud Prevention
Check fraud is a significant concern in financial transactions, with individuals attempting to alter the printed amount on checks to illegally increase the value. Preventing such fraudulent activities is critical for maintaining trust and security within financial systems.

Check protection is a powerful feature of computerized check-writing systems designed to safeguard against this type of fraud. For example, if a printed check has extra spaces because the amount is smaller than the space allows, those spaces are filled with asterisks or other characters to prevent someone from adding digits. This method makes it extremely challenging for someone to manipulate the printed amount without it being immediately obvious. A check might be issued with proper protection like so:

***99.87

where the asterisks indicate protected spaces, preventing any unauthorized alterations to the check amount.
Printing Check Amounts
When printing amounts on checks, it's not just about inputting the numbers. Care must be taken to correctly format and protect the printed amounts. Computerized systems are developed to handle varying check amounts with different space requirements.

For amounts less than \(1000, checks designed with a fixed number of spaces will likely have blank areas. These need to be filled, typically with asterisks or other characters, to prevent tampering. When a check amount like \)1230.60 needs to be printed, all available spaces are filled so no additional protection is necessary. However, smaller amounts, such as $99.87, would usually leave blank spaces. The software automatically resolves this by inserting leading characters to ensure the amount is secure from alteration, thus maintaining the integrity of the transaction.
Software Controls for Financial Systems
Software controls are the backbone of secure financial systems, particularly when dealing with sensitive operations like check writing. These controls include a series of checks and balances programmed to ensure the accuracy and authenticity of financial transactions.

In a check-writing application, software controls analyze the input dollar amount and apply rules, such as adding leading asterisks to protect the amount. Moreover, there are controls to handle exceptions, detect possible errors, and prevent the processing of checks that do not meet the predetermined criteria. This can include checks for the right number format, valid account details, and alignment with financial policies. Implementing stringent software controls is essential to maintain the reliability and security of financial systems, thus safeguarding against both unintentional errors and deliberate fraud attempts.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

(Tokenizing and Comparing Strings) Write an application that reads a line of text, tokenizes it using space characters as delimiters and outputs only those words ending with the letters "ED".

(Creating Three-Letter Strings from a Five-Letter Word) Write an application that reads a five-letter word from the user and produces every possible three- letter string that can be derived from the letters of that word. For example, the three-letter words produced from the word "bathe" include "ate," "bat, " "bet," "tab," "hat," "the "and "tea."

For each of the following, write a single statement that performs the indicated task: a) Compare the string in \(s 1\) to the string in \(s 2\) for equality of contents. b) Append the string \(s 2\) to the string \(s 1, u \sin g+=\) c) Determine the length of the string in \(s 1\)

(Displaying Strings in Uppercase and Lowercase) Write an application that inputs a line of text and outputs the text twice- -once in all uppercase letters and once in all lowercase letters.

(Project: \(A\) Spelling Checker) Many popular word-processing software packages have builtin spell checkers. In this project, you're asked to develop your own spell-checker utility. We make suggestions to help get you started. You should then consider adding more capabilities. Use a computerized dictionary (if you have access to one) as a source of words. Why do we type so many words with incorrect spellings? In some cases, it's because we simply do not know the correct spelling, so we make a best guess. In some cases, it's because we transpose two letters (e.g., "defualt" instead of "default"). Sometimes we double-type a letter accidentally (e.g., "hanndy" instead of "handy"). Sometimes we type a nearby key instead of the one we intended (e.g., "biryhday" instead of "birthday"), and so on. Design and implement a spell-checker application in Java. Your application should maintain an array wordList of strings. Enable the user to enter these strings. [Note: In Chapter 17, we introduce file processing. With this capability, you can obtain the words for the spell checker from a computerized dictionary stored in a file. Your application should ask a user to enter a word. The application should then look up that word in the wordList array. If the word is in the array, your application should print "word is spelled correctly." If the word is not in the array, your application should print "word is not spelled correctly." Then your application should try to locate other words in wordList that might be the word the user intended to type. For example, you can try all possible single transpositions of adjacent letters to discover that the word "default" is a direct match to a word in wordList. Of course, this implies that your application will check all other single transpositions, such as "edfault," "dfeault," "deafult," "defalut" and "defautl." When you find a new word that matches one in wordList, print it in a message, such as Did you mean "default"? Implement other tests, such as replacing each double letter with a single letter, and any other tests you can develop to improve the value of your spell checker.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free