# M263 - Building Blocks of Software

The flashcards below were created by user PeterN on FreezingBlue Flashcards.

1. What are whole number called in programing?
Integers
2. What name is given to the items stored in a sequence?
Elements
3. Individual letters in a word are called characters, as indicated by single inverted commas (e.g. 'c') What is the name given to a word contained in double inverted commas (e.g. "cat")?
String
4. Are any sequences other than characters contained between double inverted commas (e.g. "cat")?
No, all other sequences are kept between square brackets [ ], unless they are specifically contained in a set, identified by curly brackets { }.
5. What is a variable?
A refernce to a piece og memory.
6. What do you call the data stored in a variable at any point in time?
Its state
7. How many characters are there in the string “This text.”?
10 including a space character ' ' and a full stop '.'.
8. Which of the following are integers: 3, 0, 98, 4,−22,1/4, ‘7’, [56]?
All of them except 1/4, which isn't a whole number, '7', which is a character due to the inverted commas and [56], which is a sequence due to the brackets.
9. How many integers are there in the sequence [11, 23, 4, 56, 32]?
5
10. What are the truth values?
The boolean values, true and false.
11. What are the features of a set?
• A set is a collection of a elements of the same type
• Items don't hold a particular order
• Repeated values have no significance
• Written a ∈ X to mean that the item a is a member of the set X
• Is identified by curly brackets { }
12. What are the feastures of a sequence?
• A sequence is a collection of elements of the same type
• A sequence of characters is called a string
• Have a particular order
• Repeated values are of significance
• Is identified by square brackets [ ]
13. Let A be the set of integers between 100 and 999 inclusive.
(a) Express A in the form A = {x ∈?? : condition}
(b) What is the cardinality of A?
• (a) A = {x ∈ Int : 100 ≤ x and x ≤ 999}. (There are other correct solutions.)
• (b) There are 999 integers between 1 and 999 inclusive. The set A does not contain the integers between 1 and 99 inclusive, and there are 99 of these. So A has cardinality 999 − 99 = 900.
14. If B = {s ∈SeqOfChar : s starts with ‘T’ and s haslength4},which of the following is a member of the set B?
(a) “This”.
(b) [‘T’, ‘h’, ‘i’, ‘s’, ‘.’].
(c) [“T”, “h”, “i”, “s”].
• (a)  is correct
• (b) has a length of 5
• (c) is a sequence of strings
 Author: PeterN ID: 171460 Card Set: M263 - Building Blocks of Software Updated: 2012-10-29 20:07:37 Tags: M263 OU Folders: Description: Key words and points from course. Show Answers: