Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Cobol PROGRAMMING Since fully interactive programs that accept input and display output do not use an ENVIRONMENT ASSIGNMENTS DIVISION or FILE SECTION of the DATA
Cobol
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. 01 CENTI GRADE-TEMPERATURE PIC 99. 01 MORE.DATA PIC XXX VALUE 'YES'. PROCEDURE DIVISION. 100-MAIN. PERFORM UNTIL MORE-DATA = 'NO DISPLAY ENTER A CENTIGRADE TEMPERATURE AS AN INTEGER' ACCEPT CENTIGRADE-TEMPERATURE COMPUTE FAHRENHEIT-TEMPERATURE = 1.8 * CENTI GRADE-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 CENTI GRADE-TEMPERATURE GIVING FAHRENHEIT-TEMPERATURE Explain why the program would work properly Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started