Assistance needed.
Please type your subject in the School Subject box. Any other words are likely to delay responses from a teacher who knows that subject well.
Module main( )
Declare Integer x = 1
Declare Real y = 3.4
Display x, " ", y
Call changeUs(x, y)
Display x, " ", y
End Module
Module changeUs(Integer a, Real b)
{
Set a = 0
Set b = 0
Display a, " ", b
}
Please type your subject in the School Subject box. Any other words are likely to delay responses from a teacher who knows that subject well.
It is likely that they are passed by value.
Look at all your display statements. Think what each will show. The "Display" function probably adds end of line stuff. Otherwise, all display would be on one line.
The first one is:
1 3.4
I will make a start:
x y a b code
- - - - Module main( )
1 - - - Declare Integer x = 1
1 3.4 - - Declare Real y = 3.4
***************
**** 1 3.4 **** Display x, " ", y
***************
1 3.4 - - Call changeUs(x, y)
1 3.4 1 3.4 Module changeUs(Integer a, Real b)
1 3.4 0 3.4 Set a = 0
1 3.4 0 0 Set b = 0
*************
**** ? ? **** Display a, " ", b
*************
*************
**** ? ? **** Display x, " ", y
*************
End Module
Can you take it from here?
Declare Integer x = 3
Declare Integer y = 2
If x < 10 Then
If y > 5 Then
Display "Al can join."
Else
Display "Mary can join."
End If
Else
If y > 5 Then
Display "Mike can join."
Else
Display "Suong can join."
End If
End If
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
2. (TCO 4) What will the following pseudocode display?
Declare Integer x = 3
Declare Integer y = 8
If x < 10 Then
If y > 5 Then
Display "Al can join."
Else
Display "Mary can join."
End If
Else
If y > 5 Then
Display "Mike can join."
Else
Display "Suong can join."
End If
End If
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
3. (TCO 4) What will the following pseudocode display?
Declare Integer x = 12
Declare Integer y = 8
If x < 10 Then
If y > 5 Then
Display "Al can join."
Else
Display "Mary can join."
End If
Else
If y > 5 Then
Display "Mike can join."
Else
Display "Suong can join."
End If
End If
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
4. (TCO 4) What will the following pseudocode display?
Declare Integer x = 13
Declare Integer y = 4
If x < 10 Then
If y > 5 Then
Display "Al can join."
Else
Display "Mary can join."
End If
Else
If y > 5 Then
Display "Mike can join."
Else
Display "Suong can join."
End If
End If
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
5. (TCO 4) What value will be stored in the Boolean variable result in the following pseudocode?
Declare Integer x = 5
Declare Integer y = 10
Declare Boolean result
Set result = ( x != y OR y >= 6 )
(Points: 1)
True
False
6. (TCO 4) What value will be stored in the Boolean variable result in the following pseudocode?
Declare Integer x = 5
Declare Integer y = 10
Declare Boolean result
Set result = ( x < y OR y > 12 )
(Points: 1)
True
False
7. (TCO 4) What value will be stored in the Boolean variable result in the following pseudocode?
Declare Integer x = 5
Declare Integer y = 10
Declare Boolean result
Set result = ( x < y AND y < 6 )
(Points: 1)
True
False
8. (TCO 4) What value will be stored in the Boolean variable result in the following pseudocode?
Declare Integer x = 5
Declare Integer y = 10
Declare Boolean result
Set result = ( x > y XOR y < 12 )
(Points: 1)
True
False
9. (TCO 4) What value will be stored in the Boolean variable result in the following pseudocode?
Declare Boolean isExpensive = True
Declare Boolean isAvailable = False
Declare Boolean result
Set result = NOT (isExpensive AND isAvailable)
(Points: 1)
True
False
10. (TCO 4) What value will be stored in the Boolean variable result in the following pseudocode?
Declare Boolean isExpensive = True
Declare Boolean isAvailable = True
Declare Boolean result
Set result = ( isExpensive XOR isAvailable )
(Points: 1)
True
False
Declare Integer x = 3
Declare Integer y = 8
If x < 10 Then
If y > 5 Then
Display "Al can join."
Else
Display "Mary can join."
End If
Else
If y > 5 Then
Display "Mike can join."
Else
Display "Suong can join."
End If
End If