COP 3223H meeting -*- Outline -*- * Interactive Programming Interaction is a back and forth dialog between user and program ** two basic kinds of programs *** batch programs (like a single action, but can be run over and over, e.g., daily) ------------------------------------------ BATCH PROGRAMS input --> [ Processing ] --> output A general architecture for batch programs: def main(): data = get_input() result = process(data) print(make_report(result)) ------------------------------------------ Q: What can batch programs be used for? classically updating databases, as in banking (check clearing) scientific calculations (e.g., weather prediction) *** interactive programs (like a dialog, with back and forth, more like a phone app) ------------------------------------------ INTERACTIVE PROGRAMS User starts the program with the OS, then [ Program ] --> prompt0 | state0 v input1 --> [ Program ] --> output1, | state1 prompt1 v input2 --> [ Program ] --> output2, | state2 prompt2 v ... | state(N-1) v inputN --> [ Program ] --> outputN, promptN ------------------------------------------ The user sees the outputs and prompts and provides the inputs This could go on forever, or the user might have a way to stop it. Q: What kinds of programs are interactive? - drawing, database searches, games We'll see the architecture of this kind of program when we see loops, especially while loops...