Add to Favorites    Make Home Page 14363 Online  
 Language Categories  
 Our Services  

Home » COBOL Home » General Programs Home » Program to display english-language equivalent of an i/p number.

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Program to display english-language equivalent of an i/p number.
Description
Category COBOL » General Programs
Hits 380952
Code Select and Copy the Code
IDENTIFICATION DIVISION. PROGRAM-ID. Q11. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM PC. OBJECT-COMPUTER. IBM PC. INPUT-OUTPUT SECTION. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 01 NUM-FORMAT. 02 UNITS PIC X(6) VALUE SPACES. 02 TENS PIC X(9) VALUE SPACES. 02 HUNDREDS PIC X(15) VALUE SPACES. 02 THOUSANDS PIC X(15) VALUE SPACES. 02 TEN-THOUSANDS PIC X(10) VALUE SPACES. 02 LAKHS PIC X(15) VALUE SPACES. 02 TEN-LAKHS PIC X(10) VALUE SPACES. 02 CRORES PIC X(15) VALUE SPACES. * 02 DIGITS PIC X(15) OCCURS 8 TIMES. 77 NUM PIC 9(8). 77 NUM1 PIC 9(8). 77 REM PIC 9. 77 REM1 PIC 9. PROCEDURE DIVISION. MAIN-PARA. DISPLAY "ENTER ANY NUMBER UPTO 8 DIGITS" ACCEPT NUM. MOVE NUM TO NUM1. PERFORM CONVERTER-PARA. EXIT-PARA. STOP RUN. CONVERTER-PARA. COMPUTE REM = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 / 10 . COMPUTE REM1 = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 /10 . IF REM1 = 1 IF REM =0 MOVE "TEN" TO TENS ELSE IF REM = 1 MOVE "ELEVEN" TO TENS ELSE IF REM = 2 MOVE "TWELVE" TO TENS ELSE IF REM = 3 MOVE "THIRTEEN" TO TENS ELSE IF REM= 4 MOVE "FOURTEEN" TO TENS ELSE IF REM = 5 MOVE "FIFTEEN" TO TENS ELSE IF REM = 6 MOVE "SIXTEEN" TO TENS ELSE IF REM = 7 MOVE "SEVENTEEN" TO TENS ELSE IF REM= 8 MOVE "EIGHTEEN" TO TENS ELSE IF REM = 9 MOVE "NINETEEN" TO TENS ELSE ELSE IF REM = 0 MOVE "ZERO" TO UNITS ELSE IF REM = 1 MOVE "ONE" TO UNITS ELSE IF REM = 2 MOVE "TWO" TO UNITS ELSE IF REM = 3 MOVE "THREE" TO UNITS ELSE IF REM = 4 MOVE "FOUR" TO UNITS ELSE IF REM = 5 MOVE "FIVE" TO UNITS ELSE IF REM = 6 MOVE "SIX" TO UNITS ELSE IF REM = 7 MOVE "SEVEN" TO UNITS ELSE IF REM = 8 MOVE "EIGHT" TO UNITS ELSE IF REM = 9 MOVE "NINE" TO UNITS. IF REM1 = 2 MOVE "TWENTY" TO TENS ELSE IF REM1 = 3 MOVE "THIRTY" TO TENS ELSE IF REM1 = 4 MOVE "FOURTY" TO TENS ELSE IF REM1 = 5 MOVE "FIFTY" TO TENS ELSE IF REM1 = 6 MOVE "SIXTY" TO TENS ELSE IF REM1 = 7 MOVE "SEVENTY" TO TENS ELSE IF REM1 = 8 MOVE "EIGHTTY" TO TENS ELSE IF REM1 = 9 MOVE "NINETY" TO TENS. IF NUM1 = 0 GO TO EXIT-PARA. * FOR HUNDREDTH PLACE COMPUTE REM = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 / 10 . IF REM = 0 MOVE SPACES TO HUNDREDS ELSE IF REM = 1 MOVE "ONE HUNDRED" TO HUNDREDS ELSE IF REM = 2 MOVE "TWO HUNDRED" TO HUNDREDS ELSE IF REM = 3 MOVE "THREE HUNDRED" TO HUNDREDS ELSE IF REM = 4 MOVE "FOUR HUNDRED" TO HUNDREDS ELSE IF REM = 5 MOVE "FIVE HUNDRED" TO HUNDREDS ELSE IF REM = 6 MOVE "SIX HUNDRED" TO HUNDREDS ELSE IF REM = 7 MOVE "SEVEN HUNDRED" TO HUNDREDS ELSE IF REM = 8 MOVE "EIGHT HUNDRED" TO HUNDREDS ELSE IF REM = 9 MOVE "NINE HUNDRED" TO HUNDREDS. IF NUM1 = 0 GO TO EXIT-PARA. COMPUTE REM = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 /10 . COMPUTE REM1 = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 / 10 . IF REM1 = 1 IF REM =0 MOVE "TEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 1 MOVE "ELEVEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 2 MOVE "TWELVE THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 3 MOVE "THIRTEEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM= 4 MOVE "FOURTEEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 5 MOVE "FIFTEEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 6 MOVE "SIXTEEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 7 MOVE "SEVENTEEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM= 8 MOVE "EIGHTEEN THOUSAND" TO TEN-THOUSANDS ELSE IF REM = 9 MOVE "NINETEEN THOUSAND" TO TEN-THOUSANDS ELSE ELSE IF REM = 1 MOVE "ONE THOUSAND" TO THOUSANDS ELSE IF REM = 2 MOVE "TWO THOUSAND" TO THOUSANDS ELSE IF REM = 3 MOVE "THREE THOUSAND" TO THOUSANDS ELSE IF REM = 4 MOVE "FOUR THOUSAND" TO THOUSANDS ELSE IF REM = 5 MOVE "FIVE THOUSAND" TO THOUSANDS ELSE IF REM = 6 MOVE "SIX THOUSAND" TO THOUSANDS ELSE IF REM = 7 MOVE "SEVEN THOUSAND" TO THOUSANDS ELSE IF REM = 8 MOVE "EIGHT THOUSAND" TO THOUSANDS ELSE IF REM = 9 MOVE "NINE THOUSAND" TO THOUSANDS. IF REM1 = 2 MOVE "TWENTY" TO TENS ELSE IF REM1 = 3 MOVE "THIRTY" TO TENS ELSE IF REM1 = 4 MOVE "FOURTY" TO TENS ELSE IF REM1 = 5 MOVE "FIFTY" TO TENS ELSE IF REM1 = 6 MOVE "SIXTY" TO TENS ELSE IF REM1 = 7 MOVE "SEVENTY" TO TENS ELSE IF REM1 = 8 MOVE "EIGHTTY" TO TENS ELSE IF REM1 = 9 MOVE "NINETY" TO TENS. IF NUM1 = 0 GO TO EXIT-PARA. COMPUTE REM = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 /10 . COMPUTE REM1 = ( NUM1 / 10 ) * 10. COMPUTE NUM1 = NUM1 / 10 . IF REM1 = 1 IF REM =0 MOVE "TEN THOUSAND" TO TEN-LACS ELSE IF REM = 1 MOVE "ELEVEN THOUSAND" TO TEN-LACS ELSE IF REM = 2 MOVE "TWELVE THOUSAND" TO TEN-LACS ELSE IF REM = 3 MOVE "THIRTEEN THOUSAND" TO TEN-LACS ELSE IF REM= 4 MOVE "FOURTEEN THOUSAND" TO TEN-LACS ELSE IF REM = 5 MOVE "FIFTEEN THOUSAND" TO TEN-LACS ELSE IF REM = 6 MOVE "SIXTEEN THOUSAND" TO TEN-LACS ELSE IF REM = 7 MOVE "SEVENTEEN THOUSAND" TO TEN-LACS ELSE IF REM= 8 MOVE "EIGHTEEN THOUSAND" TO TEN-LACS ELSE IF REM = 9 MOVE "NINETEEN THOUSAND" TO TEN-LACS ELSE ELSE IF REM = 1 MOVE "ONE THOUSAND" TO LACS ELSE IF REM = 2 MOVE "TWO THOUSAND" TO LACS ELSE IF REM = 3 MOVE "THREE THOUSAND" TO LACS ELSE IF REM = 4 MOVE "FOUR THOUSAND" TO LACS ELSE IF REM = 5 MOVE "FIVE THOUSAND" TO LACS ELSE IF REM = 6 MOVE "SIX THOUSAND" TO LACS ELSE IF REM = 7 MOVE "SEVEN THOUSAND" TO LACS ELSE IF REM = 8 MOVE "EIGHT THOUSAND" TO LACS ELSE IF REM = 9 MOVE "NINE THOUSAND" TO LACS IF REM1 = 2 MOVE "TWENTY" TO TENS ELSE IF REM1 = 3 MOVE "THIRTY" TO TENS ELSE IF REM1 = 4 MOVE "FOURTY" TO TENS ELSE IF REM1 = 5 MOVE "FIFTY" TO TENS ELSE IF REM1 = 6 MOVE "SIXTY" TO TENS ELSE IF REM1 = 7 MOVE "SEVENTY" TO TENS ELSE IF REM1 = 8 MOVE "EIGHTTY" TO TENS ELSE IF REM1 = 9 MOVE "NINETY" TO TENS. **************************************************************************** IF REM = 0 AND I > 1 MOVE "Y" TO EXIT1 GO TO EXIT-PARA. IF I=2 IF REM = 1 MOVE SPACES TO DIGITS(1) IF PREV-DIGIT = 0 MOVE "TEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 1 MOVE "ELEVEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 2 MOVE "TWELVE" TO DIGITS(I) ELSE IF PREV-DIGIT = 3 MOVE "THIRTEEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 4 MOVE "FOURTEEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 5 MOVE "FIFTEEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 6 MOVE "SIXTEEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 7 MOVE "SEVENTEEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 8 MOVE "EIGHTEEN" TO DIGITS(I) ELSE IF PREV-DIGIT = 9 MOVE "NINETEEN" TO DIGITS(I). IF REM = 2 AND I =2 MOVE "TWENTY" TO DIGITS(I) ELSE IF REM = 3 MOVE "THIRTY" TO DIGITS(I) ELSE IF REM = 4 MOVE "FOURTY" TO DIGITS(I) ELSE IF REM = 5 MOVE "FIFTY" TO DIGITS(I) ELSE IF REM = 6 MOVE "SIXTY" TO DIGITS(I) ELSE IF REM = 7 MOVE "SEVENTY" TO DIGITS(I) ELSE IF REM = 8 MOVE "EIGHTTY" TO DIGITS(I) ELSE IF REM = 9 MOVE "NINETY" TO DIGITS(I). IF I IS = 1 IF REM = 0 AND I = 1 MOVE "ZERO" TO DIGITS(I) ELSE IF REM = 1 MOVE "ONE" TO DIGITS(I) ELSE IF REM = 2 MOVE "TWO" TO DIGITS(I) ELSE IF REM = 3 MOVE "THREE" TO DIGITS(I) ELSE IF REM = 4 MOVE "FOUR" TO DIGITS(I) ELSE IF REM = 5 MOVE "FIVE" TO DIGITS(I) ELSE IF REM = 6 MOVE "SIX" TO DIGITS(I) ELSE IF REM = 7 MOVE "SEVEN" TO DIGITS(I) ELSE IF REM = 8 MOVE "EIGHT" TO DIGITS(I) ELSE IF REM = 9 MOVE "NINE" TO DIGITS(I). IF I IS = 3 IF REM = 0 MOVE SPACES TO DIGITS(I) ELSE IF REM = 1 MOVE "ONE HUNDRED" TO DIGITS(I) ELSE IF REM = 2 MOVE "TWO HUNDRED" TO DIGITS(I) ELSE IF REM = 3 MOVE "THREE HUNDRED" TO DIGITS(I) ELSE IF REM = 4 MOVE "FOUR HUNDRED" TO DIGITS(I) ELSE IF REM = 5 MOVE "FIVE HUNDRED" TO DIGITS(I) ELSE IF REM = 6 MOVE "SIX HUNDRED" TO DIGITS(I) ELSE IF REM = 7 MOVE "SEVEN HUNDRED" TO DIGITS(I) ELSE IF REM = 8 MOVE "EIGHT HUNDRED" TO DIGITS(I) ELSE IF REM = 9 MOVE "NINE HUNDRED" TO DIGITS(I). DISPLAY DIGITS(I). MOVE REM TO PREV-DIGIT. ADD 1 TO I. * 02 UNITS PIC X(6) VALUE SPACES. * 02 TENS PIC X(9) VALUE SPACES. * 02 HUNDREDS PIC X(15) VALUE SPACES. * 02 THOUSANDS PIC X(15) VALUE SPACES. * 02 TEN-THOUSANDS PIC X(10) VALUE SPACES. * 02 LAKHS PIC X(15) VALUE SPACES. * 02 TEN-LAKHS PIC X(10) VALUE SPACES. * 02 CRORES PIC X(15) VALUE SPACES.

Related Source Codes

Script Name Author
sandeep kumar singh
COBOL ON-SCREEN CALCULATOR (Mini Project) Stephen Rendell
Learn Cobol in a Day C.KUMARESAN
my atm (Mini Project) sandeep kumar singh
Merge Two Files. Rakshith
Naveen Chandran P.K
Program of USSR naval stock list Jai Ganesh
PRIME NUMBER Grace Hill
Date Difference in Mainframe COBOL Muruganandham
Sequential File - Health Care C.KUMARESAN
Task for the day program. Rama Murthy M
FIBONACCI series Abir Pathak
PRIME NUMBER Grace Hill
Harmonic Series Abir Pathak
Cobol sequential file program. b.s.prakash

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=135


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review