Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete this : IDENTIFICATION DIVISION PROGRAM-ID. Work1 as Work1. AUTHOR. Yourname DATA-DIVISION. WORKING-STORAGE SECTION. 01 Num1 PIC 999 VALUE ZEROS. 01 Num2 PIC 999 VALUE

Complete this :

IDENTIFICATION DIVISION PROGRAM-ID. Work1 as "Work1". AUTHOR. Yourname DATA-DIVISION. WORKING-STORAGE SECTION. 01 Num1 PIC 999 VALUE ZEROS. 01 Num2 PIC 999 VALUE ZEROS 01 Result PIC 999999 VALUE ZEROS. 01 Operator PIC X VALUE SPACE.

PROCEDURE-DIVISION. Calculator. PERFORM 3 TIMES DISPLAY "Enter First Number (max 3-digits) : " WITH NO ADVANCING ACCEPT Num1 DISPLAY "Enter Second Number (max 3-digits) : " WITH NO ADVANCING ACCEPT Num2 DISPLAY "Enter operator (+ or *) : " WITH NO ADVANCING ACCEPT Operator IF Operator = "+" THEN ADD Num1, Num2 GIVING Result END-IF IF Operetor = "*" THEN MULTIPLY Num1 BY Num2 GIVING Result END-IF DISPLAY "Result is = ", Result END-PERFORM. STOP RUN. END-PROGRAM Exercise1.

b.) correct the syntax errors on each of the 3 division lines.

c.) Run the program with the following 3 sets of inputs:

First Number: 123

Second Number: 234

Operator: +

First Number: 505

Second Number: 330

Operator: *

First Number: 900

Second Number: 895

Operator: *

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions