Question: 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
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
Get step-by-step solutions from verified subject matter experts
