If the following pseudocode were an actual program, what would it display? Declare Integer a = 5 Declare Integer b = 2 Declare Integer c = 3 Declare Integer result Set result = a + b * c Display result
would it not just display the mathmatic result that would be 21?
Is it a=5 b=2 c=3 result=0.0 result= a+b*c print=("Your number is ",result)
hmm am i over thinking this? @hijacktrolo
probably cause to me it looks like it should just say ("Your number is 21") is there any answer choices?
OHHH i didnt read it correct, it says "Display the result" in the question It would display 21
yup :D
Cause i was trying to do it in python lol. Can you help with one more?
i can try :)
Assume the variables result, w, x, y, and z are all integers, and that w = 5, x = 4, y = 8, and z = 2. What value will be stored in result in each of the followingstatements? a. Set result = x + y do i just set it to a. set result= 4+8=12 or set result=12 ?
yeah just set it to be set result=4+8=12
oh wait you should have just made it 4+8 and the set result would be 12
so interms it would be 12=4+8
x+y= int(12) Shouldnt the code be written like that
12 being the set result and and x=4 and 8=y you wouldn't need to put the =12 on the end of the equation because its at the front.
so how should it be written?
12=4+8
set results=x+y
OHH so we just put 12=4+8
yes
Oh can you help with the last one?
sure
If the following pseudocode were an actual program, why would it not display the output that the programmer expects? Declare String favoriteFood Display "What is the name of your favorite food?" Input favoriteFood Display "Your favorite food is " Display "favoriteFood"
Isn't it because of the last one?
yes and because the input says favorite food now if you were to change the to blueberries then it would display blueberries
So we just delete the last part?
no you would just change the input
??
the input is what is telling the program to show favoriteFood now if you were to change the word favoriteFood to blueberries then the display wont show favoriteFood but instead blueberries.
Oh, the question says "why wouldnt it show" i thought their was an error in there
change Input favoriteFood this to blueberies Display "Your favorite food is " Display "favoriteFood" and this will change to blueberries
the input is why its not showing :)
also can you help me with one question?
Yea, i but the input let the user "input" something so we have to set it to the favoriteFood
well its asking what the name of the food is but when you put favoriteFood in it will just display favoriteFood
you gotta change the favoriteFood display to blueberries
also the " <--- that is highlighted
i think you foregot to put a space in between
Hmm hold up
brb
k
back
Ok, when i run the code on raptor it worked. but when i put blueb
it doesnt work so when we put something different than the declaration we get an eror
try steak
Right? so the question says "why wouldn it work" thats if we change the declaration
wait what does the bottom display say if you type in raptor
No, raptor is the program
ok so if you put raptor in the input why do none of the displays say raptor?
No, raptor is a program
ok so when you put raptor in the input does it say "your favorite food is" "raptor" ?
i dont know sorry
i was thinking because of the quotes in the last line Declare String favoriteFood Display "What is the name of your favorite food?" Input favoriteFood Display "Your favorite food is " Display "favoriteFood"
Join our real-time social learning platform and learn together with your friends!