Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 37 – Practice Exercises 9

Similar presentations


Presentation on theme: "Lecture 37 – Practice Exercises 9"— Presentation transcript:

1 Lecture 37 – Practice Exercises 9
CMPT 120 Lecture 37 – Practice Exercises 9

2 Question 1 How many distinct numbers can I represent with …
1 bit? What are these numbers? 4 bits? What are these numbers (in binary)? How many distinct numbers can I represent with 7 bits? These numbers range from ______ to _______ How many distinct numbers can I represent with 1 byte? How many distinct numbers can I represent with 32 bits? These numbers range from ______ to _______________

3 Question 2 – Convert the following numbers
Convert into an integer (decimal number): a) What is the binary equivalent of 57? b) What is the binary equivalent of 157? a) Express as an hexadecimal number: b) Express as an hexadecimal number:

4 Question 3 Translate the following message:
Answer:

5 Question 4 Problem Statement
Let’s write a binary-decimal converter in Python How would we go about solving this problem? Algorithm:

6 Question 5 Problem Statement
Write two Python functions to find the minimum number in a list The first function must compare each number to every other number on the list It complexity must be O(n2) The second function must be linear O(n)


Download ppt "Lecture 37 – Practice Exercises 9"

Similar presentations


Ads by Google