Presentation is loading. Please wait.

Presentation is loading. Please wait.

Loop Assignment.

Similar presentations


Presentation on theme: "Loop Assignment."— Presentation transcript:

1 Loop Assignment

2 Data that you should use in doing this assignment.

3 Start Problem #1: I want to produce a report using the logic shown. The report should contain ItemNo, ItemName, Price, Cost and Profit. Profit is the difference between Price and Cost. Initializing Read a record Not EOF Y Set up line for report Calculate profit Write line on report Read a record N Stop

4 Start Process Initializing Read a record OnHand > 25 Y N Not EOF Y Set up line for report process() N Stop Write line on report Read a record End Process Problem #2: Produce this report. The output should show ItemNo, ItemName, OnHand and OnOrder.

5 Start Problem #3: Produce this report. The output should show ItemNo, ItemName, OnHand and OnOrder. Process Initializing Read a record OnHand > 25 Y N OnOrder > 25 Not EOF Y N Y process() Set up line for report Set up line for report N Stop Write line on report Write line on report Read a record End Process

6 Program: start input/read record do while not EOF process() end while loop stop process() if OnHand > 25 and Price > 75 setup line for report write line for report end if input/read a record end process Problem #4: Produce this report. The output should show ItemNo, ItemName, OnHand and Price.

7 process() if VendorNo = “124” if OnOrder > 10 setup line for report write line for report else if Price > end if input/read a record end process Program: start input/read record do while not EOF process() end while loop stop Problem #5: Produce this report. The output should show ItemNo, ItemName, OnHand, OnOrder and Price.

8 Program: start input/read record do while not EOF process() end while loop stop process() if VendorNo = “124” and OnOrder > 10 or Price > 100 setup line for report write line for report end if input/read a record end process Problem #6: Produce this report. The output should show ItemNo, ItemName, OnHand, OnOrder and Price.

9 Program: start input/read record do while not EOF process() end while loop stop process() if VendorNo = “124” and (OnOrder > 10 or Price > 100) setup line for report write line for report end if input/read a record end process Problem #7: Produce this report. The output should show ItemNo, ItemName, OnHand, OnOrder and Price.


Download ppt "Loop Assignment."

Similar presentations


Ads by Google