What will the following pseudocode program display
The following solution is suggested to handle the subject “What will the following pseudocode program display“. Let’s keep an eye on the content below!
Question “What will the following pseudocode program display”
What will the following pseudocode program display?
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
}
Answer
Answer 1
It is best to create a table listing the values of each variable in order to do this type of exercise. Execute the program, and make any necessary changes to the code.
I will make a beginning:
x y a b code
– – – – Module main( )
1 – – – Declare Integer 1 = 1
1 3.4 – – Declare Real y = 3.4
***************
**** 1 3:4 **** Display “”, “, 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.0 Set a = 0.
1 3.4 0 0 Set b = 0
*************
**** ? ? **** Display “”, ” “, b
*************
*************
**** ? ? **** Display “x”, “y
*************
End Module
Is it possible to take it from there?
Answer 2
Assistance is required.
Please enter your
Subject
In the
Subjects for School
box. Teachers who are well versed in the subject will not hesitate to respond with other words.
Answer 3
. (TCO 4) What pseudocode will be displayed?
Declare Integer 3 = x
Declare Integer y = 8
If x is less than 10, then
If y is greater than 5, then
Show “Alcan join.”
Else
Show “Mary can join.”
End of
Other
If y is greater than 5, then
Display “Mike can join.”
Else
Display “Suong can join.”
End of
End of
Answer 4
Quidditch rightly pointed out that it is important to determine if ChangeUs() passes parameters by value. Make a copy or a reference to the parameters, i.e. Give the address of variables so that ChangeUs changes can affect the value of the variable within the calling module.
Answer 5
You need to determine if the pseudocode variables are passed by reference or by value.
They are likely to be passed on by value.
Take a look at all of your display statements. Consider what each one will display. Display functions usually add end-of-line stuff. All display would otherwise be on one line.
The first is:
1 3.4
Answer 6
True
Answer 7
1. (TCO 4). What pseudocode will be displayed?
Declare Integer 3 = x
Declare Integer y = 2
If x is less than 10, then
If y is greater than 5, then
Show “Alcan join”
Else
Show “Mary can join”
End of
Other
If y is greater than 5, then
Display “Mike can join.”
Else
Display “Suong can join.”
End of
End of
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
2. (TCO 4). What pseudocode will be displayed?
Declare Integer 3 = x
Declare Integer y = 8
If x is less than 10, then
If y is greater than 5, then
Show “Alcan join”
Else
Show “Mary can join”
End of
Other
If y is greater than 5, then
Display “Mike can join.”
Else
Display “Suong can join.”
End of
End of
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
3. (TCO 4). What pseudocode will be displayed?
Declare Integer 12 = x
Declare Integer y = 8
If x is less than 10, then
If y is greater than 5, then
Show “Alcan join.”
Else
Show “Mary can join.”
End of
Other
If y is greater than 5, then
Display “Mike can join.”
Else
Display “Suong can join.”
End of
End of
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
4. (TCO 4). What pseudocode will be displayed?
Declare Integer 13 = x
Declare Integer y = 4
If x is less than 10, then
If y is greater than 5, then
Show “Alcan join.”
Else
Show “Mary can join.”
End of
Other
If y is greater than 5, then
Display “Mike can join.”
Else
Display “Suong can join.”
End of
End of
(Points: 1)
Al can join.
Mary can join.
Mike can join.
Suong can join.
5. (TCO 4). What value will be saved in the Boolean variable result of the following pseudocode?
Declare Integer 5 = x
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 saved in the Boolean variable result of the following pseudocode?
Declare Integer 5 = x
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 saved in the Boolean variable result of the following pseudocode?
Declare Integer 5 = x
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 saved in the Boolean variable result of the following pseudocode?
Declare Integer 5 = x
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 saved in the Boolean variable result of the following pseudocode?
Boolean = Expensive
Declare Boolean available = False
Declare Boolean result
Set result = NOT (isExpensive and isAvailable).
(Points: 1)
True
False
10. (TCO 4). What value will be saved in the Boolean variable result of the following pseudocode?
Boolean = Expensive
Declare Boolean available = True
Declare Boolean result
Set result = “isExpensiveXOR isAvailable”
(Points: 1)
True
False
Conclusion
Above is the solution for “What will the following pseudocode program display“. We hope that you find a good answer and gain the knowledge about this topic of college.