plz friends help me

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 4
Reputation: star22 is an unknown quantity at this point 
Solved Threads: 0
star22 star22 is offline Offline
Newbie Poster

plz friends help me

 
0
  #1
Aug 13th, 2006
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.



Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: plz friends help me

 
0
  #2
Aug 13th, 2006
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: plz friends help me

 
0
  #3
Aug 13th, 2006
The first part is simple.

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

  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.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 4
Reputation: star22 is an unknown quantity at this point 
Solved Threads: 0
star22 star22 is offline Offline
Newbie Poster

Re: plz friends help me

 
0
  #4
Aug 13th, 2006
thank u friend but how can I find example from google
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,341
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 236
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: plz friends help me

 
0
  #5
Aug 13th, 2006
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?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC