100 likes | 217 Views
Loop Assignment. There are no speaker notes to accompany this assignment. Data that you should use in doing this assignment. Start.
E N D
Loop Assignment There are no speaker notes to accompany this assignment.
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
Start Process Calculate profit Initializing Read a record Set up line for report Not EOF Y process() N Write line on report Stop Read a record End Process Problem #2: Is there any difference in the output using the logic in problem #1 and using the logic shown here? Explain.
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 #3: Produce this report. The output should show ItemNo, ItemName, OnHand and OnOrder.
Start Problem #4: 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
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 #5: Produce this report. The output should show ItemNo, ItemName, OnHand and Price.
process() if VendorNo = “124” if OnOrder > 10 setup line for report write line for report else if Price > 100.00 setup line for report write line for report end if end if end if input/read a record end process Program: start input/read record do while not EOF process() end while loop stop Problem #6: Produce this report. The output should show ItemNo, ItemName, OnHand, OnOrder and Price.
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.
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 #8: Produce this report. The output should show ItemNo, ItemName, OnHand, OnOrder and Price.