Assignment 17 — conditional analysis
Due Tuesday, March 13
Program same_difference.py
- Produce a program that prompts its user for two integer inputs and reports whether or not they have same sign.
- They have the same sign if they are both positive or are both negative. For assignment purposes, zero is a positive number. If they have the same sign, print
'have same sign'
; otherwise, print'have different signs'
.
- The only program output besides the prompt is the relationship between the two input values.
- Four sample runs
Enter two numbers: 3 -5have different signs
Enter two numbers: -2 -1have same sign
Enter two numbers: 8 8have same sign
Enter two numbers: -12 11have different signs
Warning: fopen(/l/cs1112/public_html/defs/htm/181-trailer): Failed to open stream: No such file or directory in /l/cs1112/public_html/defs/php/read.php on line 5
Unable to open file!