Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

with openCobol Program 1 (name this LAB2-PROGRAM1) This is an interactive program. The goal is to prompt the user for the cont of an item

with openCobol
image text in transcribed
Program 1 (name this LAB2-PROGRAM1) This is an interactive program. The goal is to prompt the user for the cont of an item and store it to an appropriate COBOL variable. Atter each value is entered, the user is prompted to determine whether to contimue (i.e., get another cost value) or display the total. Entering a negative value for cost will act as a sentinel and when your code detects it, exit the data entry loop and display the total. A. COBOL uses the PERFORM UNTL/END PERFORM statement like lava and C++ use a whille() loop. B. In addition to the input-capture variable, you'll need another one to add the current cost to the variable storing the total. The total is an accumulator variable so think about what you must do before starting the data entry loop. C. Make sure your variable names are descriptive, follow standard naming, and don't collide with COBOL reserved words. Sample input/output dialog. You can use simple values, like 5.00 when testing it to speed things up; they don't have to be unique costs - just so the total correctly: Enter iten cost or a negative value to quit: 45.99 Eriter item cost or a negative value to quit: 19.99 Enter 1 teen cost or a negative value to quit: 245.95 Enter ites cost or a negative value to quit: 10504.50 Enter iten cost or a negative value to quit: 1000000,00 Enter itea cost or a negative value to quit: 1 Total cost? $1,010,816.43 Adjust your PIC clauses to get output with suppressed leading O's and showing dollars and cents monetary noteation

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_2

Step: 3

blur-text-image_3

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

1. What might have led to the misinformation?

Answered: 1 week ago