IDENTIFICATION DIVISION. PROGRAM- ID. TEMPERATURES. DATA DIVISION. WORKING-STORAGE SECTION. FAHRENHEIT-TEMPERATURE PIC 99.9. 01 01 CENTIGRADE-TEMPERATURE PIC 99. 01 MORE -DATA PROCEDURE DIVISION. 100- MAIN, PERFORM UNTIL MORE-DATA = 'NO PIC XXX VALUE 'YES'. DISPLAY 'ENTER A CENTIGRADE TEMPERATURE AS AN INTEGER' ACCEPT CENTIGRADE -TEMPERATURE COMPUTE FAHRENHEIT TEMPERATURE = 1.8 CENTIGRADE-TEMPERATURE + 32 DISPLAY 'FAHRENHEIT TEMPERATURE , FAHRENHEIT-TEMPERATURE DISPLAY 'IS THERE MORE INPUT (YES OR NO)?' ACCEPT MORE - DATA END - PERFORM STOP RUN. a. Indicate what the above program accomplishes, step by step. (Note that in the COMPUT tatomont meane multinlicatHon)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
PROGRAMMING Since fully interactive programs that accept input and display output do not use an ENVIRONMENT
ASSIGNMENTS DIVISION or FILE SECTION of the DATA DIVISION, they are much easier to code.
Interactive Programs
1. Consider the following:
IDENTIFICATION DIVISION.
PROGRAM- ID. TEMPERATURES.
DATA DIVISION.
WORKING-STORAGE SECTION.
01
FAHRENHEIT-TEMPERATURE PIC 99.9.
CENTIGRADE-TEMPERATURE PIC 99.
MORE - DATA
PROCEDURE DIVISION.
100-MAIN,
01
01
PIC XXX VALUE 'YES'.
PERFORM UNTIL MORE-DATA = 'NO
DISPLAY 'ENTER A CENTIGRADE TEMPERATURE AS AN INTEGER'
ACCEPT CENTIGRADE-TEMPERATURE
COMPUTE FAHRENHEIT-TEMPERATURE = 1.8 *
CENTIGRADE -TEMPERATURE + 32
DISPLAY 'FAHRENHEIT TEMPERATURE , FAHRENHEIT - TEMPERATURE
DISPLAY 'IS THERE MORE INPUT (YES OR NO)?"
ACCEPT MORE - DATA
END- PERFORM
STOP RUN.
a. Indicate what the above program accomplishes, step by step. (Note that * in the COMPUTE
statement means multiplication.)
b. What is the purpose of the COMPUTE statement?
C. Suppose the COMPUTE statement were coded instead as:
MULTIPLY 1.8 BY CENTIGRADE-TEMPERATURE
ADD 32 TO CENTIGRADE-TEMPERATURE GIVING
FAHRENHEIT-TEMPERATURE
Explain why the program would work properly.
Transcribed Image Text:PROGRAMMING Since fully interactive programs that accept input and display output do not use an ENVIRONMENT ASSIGNMENTS DIVISION or FILE SECTION of the DATA DIVISION, they are much easier to code. Interactive Programs 1. Consider the following: IDENTIFICATION DIVISION. PROGRAM- ID. TEMPERATURES. DATA DIVISION. WORKING-STORAGE SECTION. 01 FAHRENHEIT-TEMPERATURE PIC 99.9. CENTIGRADE-TEMPERATURE PIC 99. MORE - DATA PROCEDURE DIVISION. 100-MAIN, 01 01 PIC XXX VALUE 'YES'. PERFORM UNTIL MORE-DATA = 'NO DISPLAY 'ENTER A CENTIGRADE TEMPERATURE AS AN INTEGER' ACCEPT CENTIGRADE-TEMPERATURE COMPUTE FAHRENHEIT-TEMPERATURE = 1.8 * CENTIGRADE -TEMPERATURE + 32 DISPLAY 'FAHRENHEIT TEMPERATURE , FAHRENHEIT - TEMPERATURE DISPLAY 'IS THERE MORE INPUT (YES OR NO)?" ACCEPT MORE - DATA END- PERFORM STOP RUN. a. Indicate what the above program accomplishes, step by step. (Note that * in the COMPUTE statement means multiplication.) b. What is the purpose of the COMPUTE statement? C. Suppose the COMPUTE statement were coded instead as: MULTIPLY 1.8 BY CENTIGRADE-TEMPERATURE ADD 32 TO CENTIGRADE-TEMPERATURE GIVING FAHRENHEIT-TEMPERATURE Explain why the program would work properly.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education