Uploaded by Anonymous

Array Homework

advertisement
Homework/Worksheet
Name:
Class
What is a variable?
Write the pseudocode to declare a variable Number as integer.
Write the pseudocode to declare a variable Name as string and assign it value “Lisa”.
Write the pseudocode to declare a variable Salary and choose appropriate data type for it.
Write the pseudocode to declare a variable isHot and choose appropriate data type for it.
Explain the meaning of the following terminology.
Array:
Array dimension:
Array index:
Write the pseudocode to declare an integer array Data of 5 elements.
Write the pseudocode to declare an array Cities that can store 99 cities name.
Write the pseudocode to output the first element from the array x [12,44,33,66,53,22,66,9].
Write the pseudocode to output the second element from the array
Colours [“Red”,” Blue”,” Green”].
Write the pseudocode to ask the user the input a colour and store it in the 3rd position
Colours [“Red”, ”Blue”, ”Green”].
Write the pseudocode to store 5th element of array Players in a variable PlayerName and output the
value of this variable. Players [“Messi”, “Ronaldo”, “Neymar”,” Robert”, ”Kevin”]
Identify and describe three basic data types.
1.
2.
3.
Write the pseudocode to ask the user to input 3 whole numbers, store them in 3 different variables,
and output a message saying: “You input” followed by values of variables.
Write the pseudocode to assign the values, 10, 20 and 30 to three variables.
Write the pseudocode to only accept a parcel between 0.5 and 5.0 kilograms.
Download