Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

To prevent a dollar amount from being altered, most computerized check-writing s

ID: 3561471 • Letter: T

Question

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 a paycheck contains nine blank spaces in which the computer is supposed to print the amount of a weekly paycheck. If the amount is large, then all nine of those spaces will be filled--for example:

1, 230.60 (check amount)

-----------

123456789 (position numbers)

On the other hand, if the amount is less than $1000, then several of the spaces will ordinarily be left blank ---- for example: 99.87 ----------- 123456789 Contains three blank spaces. If the 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

----------

123456789

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. THEN Write a second script that inputs a numeric check amount and writes the word equivalent of the amount. For example, the amount 112.43 should be written as ONE HUNDRED TWELVE and 43/100. ( I need program in HTML/JAVASCRIPT code only please ) Thank you in advance

Explanation / Answer

<html>
<head>
<title> Demo Code </title>
<script>
window.onload = init;
function init(){
var submitButton = document.getElementById("sub");
submitButton.onclick = submitButtonClick;
}
function submitButtonClick() {
var txt = document.getElementById("amount").value;
var lngth = txt.length;
var appnd = "";
for(i=0;i< 9-parseInt(lngth);i++)
{
appnd = appnd + "*";
}
document.getElementById("output").innerHTML = " Computer reads it as "+ appnd + txt;
}
</script>
</head>
<body>
<h1>Prevent dollar amount being altered </h1>

<p>Amount : </p>
<input type="text" name="amount" id="amount" maxlength="9" />
<button type="submit" name="Submit" id="sub">Submit</button>
<p id="output"></p>
</body>
</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote