Input, Processing, and Output
, Designing a Program
Programs must be designed before they are written
Program development cycle:
1. Design the program
2. Write the code
3. Correct syntax errors
4. Test the program
5. Correct logic errors
, Input, Processing, and Output
• Typically, computer performs three-step process
• Receive input
• Input: any data that the program receives while it is running
• Perform some process on the input
• Example: mathematical calculation
• Produce output
Calculate the
average
Input: Output:
3 numbers The average
, Displaying Output with the print Function
print function: displays output on the screen
Example the statement
print(‘Hello world’)
Will display the message: Hello world
String: sequence of characters that is used as data
String literal: string that appears in actual code of a
program
Must be enclosed in single (') or double (") quote marks
So the above statement also can be written
print(“Hello world”)
Using double (“) quote