943,935 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1668
  • C++ RSS
Aug 13th, 2006
0

plz friends help me

Expand Post »
plz friends help me to solve this proplem by c++ language:




Question (Check Protection and word interpretation)

Problem Concept - Computers are frequently used in check-writing systems, such as pay-roll and accounts payable applications. Many strange stories circulate regarding weekly paychecks being printed (by mistake) for amounts in excess of RM 1 million. Weird amounts are printed by computerized check writing systems because of human error and/or machine failure. Systems designers, make every effort to build controls into their systems to prevent erroneous checks from being issued.

Another serious problem is the international 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 as check protection.

Problem statement: Write a program that inputs a numeric 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 the amount. Extend the program segment to write the word equivalent of the amount in the following line.

Sample Data: 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 the nine of those spaces will be filled. For example,

11 ,230 .60 ß check amount
----------------------------------------
123456789 ß position numbers.

On the other hand, if the amount is less than $ 1000, then several of the spaces wouald be ordinarily left blank. For example:

99 .87 ß check amount
---------------------------------------
123456789 ß position numbers.

contains 3 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 ß check amount
----------------------------------------
123456789 ß position numbers.

The program should also print the output of the value of dollars in words in the next line. For example:

112.43 is printed as

RM ***112 .43
ONE HUNDRED TWELVE AND 43/100.


Program Output: The program should read a numeric dollar value, and determine the number of spaces before printing its output with proper check-protection. It should also print the value of the dollar in words in the next line aligning it to the right.



Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
star22 is offline Offline
4 posts
since Aug 2006
Aug 13th, 2006
0

Re: plz friends help me

Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Aug 13th, 2006
0

Re: plz friends help me

The first part is simple.

You can use a for loop to print the number of spaces:

C++ Syntax (Toggle Plain Text)
  1. for (i = 0; i < V; i++)
  2. {
  3. System.out.println(" ");
  4. }

Where V is a variable. You could make use of string.length() to ascertain the length of the string.

The second part converting numbers to words is a bit harder. But if you google you can find some examples that have already done most of it for you.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Aug 13th, 2006
0

Re: plz friends help me

thank u friend but how can I find example from google
Reputation Points: 10
Solved Threads: 0
Newbie Poster
star22 is offline Offline
4 posts
since Aug 2006
Aug 13th, 2006
0

Re: plz friends help me

Quote originally posted by star22 ...
thank u friend but how can I find example from google
Isn't the point of the assignment for you to learn how to program?
As opposed to learning how to Google for your exact problem?
Which do you want to do -- learn to Google or learn to program?
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: OOPS concepts in c++ ...
Next Thread in C++ Forum Timeline: Math Functions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC