Safaricom IoT CAT 2

/13

This quiz is timed to 90 minutes

After timer finished counting down, Exam has been submitted automatically.


Created on

Safaricom Digital Academy Cohort 4 Group B

INTERNET OF THINGS

CONTINUOUS ASSESSMENT TEST 2

WEEK 8 - THURSDAY 27TH APRIL 2023

LECTURER: SAMUEL L. MBAI

Please Register for the Exam

1 / 13

1. What is the difference between Lists and Tuples in Python? Give an example code for their usage. (4 marks)

2 / 13

2. What type of conditional structures are present in Python? Explain four with example. (8 marks)

3 / 13

3. Differentiate between mutable and immutable objects in Python language with example. (2 marks)

4 / 13

4. Study the following program and write the possible output(s). Also, write the maximum and the minimum values that can be assigned to the variable Y. (4 marks)

import random

X= random.random()

Y= random.randint(0,4)

print(int(X),":",Y+int(X))

5 / 13

5. What are the basic steps to connect Python with MYSQL (2 marks)

6 / 13

6. For this part, you will be required to open Python IDE.

Paste the code only under the answers for each question

Paste the screenshots on a separate word document and send to my email

Create a Database called EMPLOYEE (2 Marks)

(Paste the code here, then paste the screenshot on a word document to be shared separately on my email)

7 / 13

7. Create the tables STAFF and SALARY. (3 Marks)

STAFF TABLE contains the fields (Staff ID, Name, Department, Gender, Experience)

SALARY TABLE contains the fields (Staff ID, Basic, Allowance, Commission)

(Paste the code only here, then paste the screenshot on a word document that will be shared separately to my email)

8 / 13

8. Write a code to insert data into the tables (At least 6 entries) (5 Marks)

(Paste the code only here, then paste the screenshot on a word document that will be shared separately to my email)

9 / 13

9. Display NAMEs of all the staff members who are in “ICT” department having more than 10 years’ experience. (3 Marks)

(Paste the code only here, then paste the screenshot on a word document that will be shared separately to my email)

10 / 13

10. Display the average Basic Salary of all staff members working in “Finance” department. (4 marks)

(Paste the code only here, then paste the screenshot on a word document that will be shared separately to my email)

11 / 13

11. Display the minimum ALLOWANCE of female staff. (3 marks)

(Paste the code only here, then paste the screenshot on a word document that will be shared separately to my email)

12 / 13

12. Display the highest commission among all male staff. (3 Marks)

(Paste the code only here, then paste the screenshot on a word document that will be shared separately to my email)

13 / 13

13. This is the last question to confirm before you finish:

Have you submitted the separate word document containing the screenshots to my email?

Your score is

0%