Variables


examples


Classwork

In a text document:

1. What would be printed if a program represented by this pseudocode runs?

x = 12
y = x + 3
z = "x"
w = "xyz"
x = x - 2
z = "y"
print("x is " + x)
print("x is x")
print("y is " + y)
print("z is " + z)
print("w is " + w)

2. Write pseudocode to represent the following: there are ten dogs and twice as many cats, then we bought 5 more dogs. Print the final numbers of dogs and cats.