Reference no: EM133087575
Modelling, Abstraction and Algorithms
Exercises
Question 1. In your own words, describe what data abstraction is and how it is used. How is data abstraction different from process abstraction?
Question 2. Draw an Activity Diagram / Flowchart for the task of Sending an email with an attachment via the Google Inbox web interface (if you don't have a gmail account just do it for generically sending an email with an attachment).
Question 3. Draw a class diagram for a DigitalRadio object. A radio has the following properties (which you should choose appropriate data types for):
- state (on / off)
- frequency (i.e. 107.1MHz)
- volume (a whole number value 0 through 10 inclusive)
The radio also has the following methods:
- switch_on()
- switch_off()
- change_volume(new volume),
- change_frequency(new_frequency), and
- find_next_channel(ascending = True).
Question 4. Draw a class diagram for a class that describes a PedestalFan- come up with your own properties / attributes and methods to change or control the fan's properties:
5. Write an algorithm in pseudocode to print out the expansion of a series of factorial numbers, for example:
2! = 2 x 1
3! = 3 x 2 x 1
4! = 4 x 3 x 2 x 1
Question 6. Demonstrate the sequence of swaps required to sort the following list of numbers using a Bubble Sort. In your answer you should write out the new sequence of numbers every time a value changes place.
Question 7. Demonstrate the sequence of swaps required to sort the following list of numbers using a Selection Sort. In your answer you should write out the new sequence of numbers every time a value changes place.
Question 8. In your own words, explain why sorting is so important to searching.
Attachment:- Abstraction and Algorithms.rar