QUESTION IMAGE
Question
write the pseudocode statements to output the sum of x and y if x and y are both negative numbers. otherwise the program outputs the value of x. the value of x and y will be entered by the user.
Step1: Input values
Get values of \(x\) and \(y\) from user.
Step2: Check conditions
Use an If - Then - Else structure. Check if \(x<0\) and \(y < 0\).
Step3: Calculate and output
If both are negative (\(x<0\) AND \(y < 0\)), calculate sum \(x + y\) and output. Else, output \(x\).
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
Input x
Input y
If x < 0 AND y < 0 Then
sum = x + y
Output sum
Else
Output x
End If