Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

(Check Protection) Computers are frequently employed in check-writing systems such as payroll and accounts-payable applications. Many strange stories circulate regarding weekly paychecks being printed (by mistake) for amounts in excess of \(1 million. Weird 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 intends to cash a check fraudulently. To prevent a dollar amount from being altered, most 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 that a paycheck contains eight blank spaces in which the computer is supposed to print the amount of a weekly paycheck. If the amount is large, then all eight of those spaces will be filled, for example, 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, 99.87 \-------- 12345678 contains three blank spaces. If a check is printed with blank spaces, it is easier for someone to alter the amount of the check. To prevent a check from being altered, many check-writing systems insert leading asterisks to protect the amount as follows: ***99.87 \-------- 12345678 Write a program that inputs a dollar amount to be printed on a check and then prints the amount in check-protected format with leading asterisks if necessary. Assume that nine spaces are available for printing an amount.

Short Answer

Expert verified
Format the amount with leading asterisks to fill nine spaces.

Step by step solution

01

Understand the Problem

The task is to ensure that a dollar amount is printed on a check using a protected format. We need to fill any unused spaces with asterisks. In this scenario, we're given nine spaces to print the amount.
02

Prepare the Input

We assume that the input is a numeric value representing the dollar amount. This amount should be formatted to have exactly two decimal places for cents.
03

Format the Dollar Amount

Convert the input amount to a string with two decimal places (e.g., for $99.87, the string should be '99.87'). This ensures that the cents are always represented, even if they are zero (e.g., $100 becomes '100.00').
04

Determine Spaces Required

Calculate the number of actual spaces the formatted amount requires. For instance, '99.87' occupies five spaces and '1000.00' occupies seven spaces.
05

Calculate the Number of Asterisks Needed

Subtract the length of the amount from nine (the total number of spaces), leaving us with the number of asterisks needed to reach nine spaces. For instance, if the formatted amount '99.87' uses five spaces, then four asterisks are needed.
06

Construct the Protected Format

Combine the calculated number of asterisks with the formatted amount into a single string. For example, four asterisks followed by '99.87' results in '****99.87'.
07

Output the Check-Protected Amount

Print the final check-protected amount string. This ensures the check amount is secure against alterations.

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.

Human Error Prevention
Human error is a leading cause of discrepancies in the payroll and finance sectors, especially when it comes to printing checks. Discrepancies may arise due to simple typing errors, misinterpretations, or oversight during processing. A key strategy in dealing with this is the implementation of preventive measures right at the software level.
  • Software-Enabled Checks: By embedding smart algorithms and automated checks into software, errors due to human oversight can be greatly minimized.
  • Verification Mechanisms: Verification mechanisms, such as double-entry checks or confirmation prompts, can reduce errors. When inputting critical data like check amounts, having an additional step ensures that any errors are caught early.
  • User Training: Proper training for users interacting with check-writing systems is crucial. Awareness and education about potential errors and their impacts can foster a more careful approach in data handling.
By focusing on these areas, organizations can significantly reduce the risk of errors before they cascade into larger issues.
Check Fraud Detection
Fraudulent activities targeting checks are a significant concern for financial operations. Protecting checks from fraud involves recognizing and mitigating unauthorized modifications.
  • Tamper-Evident Design: Designing checks with features that highlight any tampering is an effective deterrent. For example, using special ink or patterns that reveal alterations is one method.
  • Electronic Verification: Employing technological solutions such as verification codes or QR codes can add an extra layer of security. These can be unique to each check, making unauthorized reproductions ineffective.
The essence of check fraud detection lies in anticipating potential fraudulent methods and effectively countering them with proactive security designs.
Computerized Check-Writing Systems
Computerized check-writing systems have revolutionized financial operations by automating the check issuance process. These systems bring about efficiency, accuracy, and enhanced security.
  • Automation: Reducing manual entry by automating the entry of amounts minimizes the chances of errors and expedites the processing time.
  • Standardization: By standardizing the checks through software, organizations ensure that all checks adhere to a uniform template, reducing variations and potential errors.
  • Integration: Modern systems often integrate with accounting software, allowing for seamless transactions and real-time data validation.
With these systems, financial institutions can achieve higher levels of operational efficiency while safeguarding against erroneous checks.
Input Validation and Formatting
Input validation and formatting are critical processes in ensuring that the data entered into the system meets required specifications, reducing possible errors and fraudulent manipulations.
  • Validation Checks: A robust check-writing system should perform validation checks to make sure inputs meet specific criteria like non-empty fields, appropriate range, and proper formatting.
  • Consistent Formatting: Ensuring consistent formatting, especially in numerical data such as monetary values, aids in preventing errors. For example, always formatting values to two decimal places (e.g., '100.00') helps avoid misinterpretation.
  • Asterisk Padding: As the final deterrent against fraud, systems add padding with symbols like asterisks for amounts shorter than the designated field width to prevent illicit alteration.
Employing thorough validation routines and formatting guidelines ensures that check amounts remain within their intended structure, safeguarding them from unintentional changes.

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

(A Metric Conversion Program) Write a program that will assist the user with metric conversions. Your program should allow the user to specify the names of the units as strings (i.e., centimeters, liters, grams, etc., for the metric system and inches, quarts, pounds, etc., for the English system) and should respond to simple questions such as "How many inches are in 2 meters?" "How many liters are in 10 quarts?" Your program should recognize invalid conversions. For example, the question "How many feet are in 5 kilograms?" is not meaningful, because "feet" are units of length, while "kilograms" are units of weight

(Text Analysis) The availability of computers with string-manipulation capabilities has resulted in some rather interesting approaches to analyzing the writings of great authors. Much attention has been focused on whether William Shakespeare ever lived. Some scholars believe there is substantial evidence indicating that Christopher Marlowe or other authors actually penned the masterpieces attributed to Shakespeare. Researchers have used computers to find similarities in the writings of these two authors. This exercise examines three methods for analyzing texts with a computer. Note that thousands of texts, including Shakespeare, are available online at www.gutenberg.org. a. Write a program that reads several lines of text from the keyboard and prints a table indicating the number of occurrences of each letter of the alphabet in the text. For example, the phrase To be, or not to be: that is the question: contains one "a," two "b's," no "c's," etc. b. Write a program that reads several lines of text and prints a table indicating the number of one-letter words, two-letter words, threeletter words, etc., appearing in the text. For example, the phrase Whether 'tis nobler in the mind to suffer contains the following word lengths and occurrences:c. Write a program that reads several lines of text and prints a table indicating the number of occurrences of each different word in the text. The first version of your program should include the words in the table in the same order in which they appear in the text. For example, the lines To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer contain the words "to" three times, the word "be" two times, the word "or" once, etc. A more interesting (and useful) printout should then be attempted in which the words are sorted alphabetically.

Write a program that inputs a line of text, tokenizes the line with function strtok and outputs the tokens in reverse order.

The arrays should be filled as follows: The article array should contain the articles "the", "a", "one", "some" and "any"; the noun array should contain the nouns "boy", "girl", "dog", "town" and "car"; the verb array should contain the verbs "drove", "jumped", "ran", "walked" and "skipped"; the preposition array should contain the prepositions "to", "from", "over", "under" and "on".

(Writing the Word Equivalent of a Check Amount) Continuing the discussion of the previous example, we reiterate the importance of designing checkwriting systems to prevent alteration of check amounts. One common security method requires that the check amount be both written in numbers and "spelled out" in words. Even if someone is able to alter the numerical amount of the check, it is extremely difficult to change the amount in words. Write a program that inputs a numeric check amount and writes the word equivalent of the amount. Your program should be able to handle check amounts as large as $99.99. For example, the amount 112.43 should be written as ONE HUNDRED TWELVE and 43/100

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