Answer:
The program in Python is as follows:
num1 = int(input())
num2 = int(input())
if num1 >=0 and num2 >= 0:
print(num1+num2)
elif num1 <0 and num2 < 0:
print(num1*num2)
else:
if num1>=0:
print(num1**2)
else:
print(num2**2)
Step-by-step explanation:
This gets input for both numbers
num1 = int(input())
num2 = int(input())
If both are positive, the sum is calculated and printed
if num1 >=0 and num2 >= 0:
print(num1+num2)
If both are negative, the products is calculated and printed
elif num1 <0 and num2 < 0:
print(num1*num2)
If only one of them is positive
else:
Calculate and print the square of num1 if positive
if num1>=0:
print(num1**2)
Calculate and print the square of num2 if positive
else:
print(num2**2)