QuestionQuestion

Interactive Message Program
Students, particularly those in elementary school, sometimes have to write a line such as “I will not chew gun in class.” on the board a number of times. Modernize this process. Write a program that will interactively ask the user for the message and the number of times it must be written, and then write the message to the screen the required number of times. Display 20 lines on the screen and stop until the user wants another screen’s worth. The lines should be numbered. For example, if the user wants to write the message “I will not chew gum in class.” 100 times. Then, the program must write the message to the screen 20 times, numbered 1 through 20, and stop. When the user wants another screen’s worth, the program must write the message to the screen 20 more times, numbered 21 through 40, and stop. So on and so forth until the message has been written 100 times to the screen.

The assignment’s requirements are as follows:
1. Create the Pseudocode for the program. Save the file as LastnameFirstinitialA7.docx (e.g., BasilioEA7.docx) or LastnameFirstinitialA7.pdf (e.g., BasilioEA7.pdf).
2. Code the COBOL program and save the source file as LastnameFirstinitialA7.cbl (e.g., BasilioEA7.cbl).
3. Include comments describing the purpose of the program and to provide the required class identifying information. 4. The PROGRAM-ID section of the IDENTIFICATION DIVISION must be written as LastnameFirstinitialA7 (e.g., BasilioEA7).
5. Use SCREEN SECTION to capture the message, as well as the number of times to write the message, and to display the output to the screen. For this assignment extended ACCEPT and DISPLAY statements ARE NOT ALLOWED.   
6. Submit the Pseudocode and COBOL source file via the A7 link by the end of Week 7 - Sunday 11:59 PM.
Note: The assignment’s rubric is visible within the assignment information.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

IDENTIFICATION DIVISION.
       PROGRAM-ID. YOUR-PROGRAM-NAME.
       DATA DIVISION.
       FILE SECTION.
       WORKING-STORAGE SECTION.
       *> INPUT MESSAGE
       01 MSG_IN          PIC X(40).
       *> NUMBER OF MESSAGE TO BE PRINTED OUT
       01 TIME_IN         PIC 9(3).
       *> CURRENT NUMBER OF PRINTED LINE
       01 COUNTER         PIC 9(3) VALUE 0.
       *> THIS VARIALBE HELPS US TO PRINT LESS THAN 20
       *> LINE IN THE SCREEN IF IT'S NEEDED
       01 S-VAL          PIC 9(3).
       *> USER PRESS ANY KEY TO CONINUE
       01 KEY-IN          PIC X(1).

       SCREEN SECTION.
       *> INPUT SCREEN
       01 INPUT-SCREEN.
          05 BLANK SCREEN
               FOREGROUND-COLOR 1
               BACKGROUND-COLOR 7.
          05 LINE 2 COLUMN 5 VALUE
                   "ENTER THE MESSAGE:"
                   FOREGROUND-COLOR 1
                   BACKGROUND-COLOR 7.
          05 COLUMN 31 PIC X(40) TO MSG_IN.
          05 LINE 4 COLUMN 5 VALUE
                   "ENTER THE NUMBER OF TIME:"
                   FOREGROUND-COLOR 1
                   BACKGROUND-COLOR 7.
          05 COLUMN 31 PIC X(6) TO TIME_IN....

By purchasing this solution you'll be able to access the following files:
Solution.docx and Solution.cbl.

$70.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats