Sale!

Lab # 1 ITI 1120 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (4 votes)

Objectives
• Installing Python and starting IDLE
• Creating and Submitting a Practice Assignment 0 on Brightspace
• Enrolling into two Python courses on Coursera (this only reason
for this is so you get access to their Coursera quizzes for selfevaluation purposes)
• Writing your first Python program
• Two Python programming exercises (with Turtle graphics)
• Blockly exercises
3
Accessing Brightspace
• What is at Brightspace?
– All the course material is there (think of it as the course web page)
– Downloading and submitting assignments
– Downloading and submitting tests
– Announcements
– Consulting your grades.
– Discussion groups/forums
– Students are required to check Brighhtspace course webpage and their
OttawaU email frequently for announcements and all material.
• To access brightspace:
– Go to https://uottawa.brightspace.com/d2l/home
– Enter your user name and password and sign In.
– Click on ITI1120 to access the course
4
Starting Lab 1
• Open a browser and log into Brightspace
• On the left hand side under Labs tab, find lab1 material
contained in lab1-students.zip file
• Download that file and unzip it.
5
Starting Lab 1
• Open the file provided with this lab called OpeningIDLE.pdf
• Follow the 5 steps described in OpeningIDLE.pdf
In Python shell type:
• type 1+2*3, press enter and observe the output
• Then type (1+2)*3, press enter and observe the output
• Then type 2**10, press enter and observe the output
• Then type 11/2, press enter and observe the output
• Then type in the expression that sums first 5 positive integers
• Then type the expression that finds average of 25, 12, 40 and 1
6
7
Practice Submitting Assignment 0
• First to learn how to create your submission follow the steps below:
– Open the file provided with this lab called UsingIDLE-first-program.pdf
– Follow the 10 steps to create Python program A0_xxxxxxx. py and place it in the folder you crated called A0_xxxxxxx.
(Note that what you see on your computers may differ slightly from that what you see in UsingIDLE- first-program.pdf)
– Right-click on the A0_xxxxxxx folder and then select “Add to A0_xxxxxxx.zip”.
• This will create a zip file with the contents of the directory.
• Then to submit (A0_xxxxxxx.zip) follow the steps below: – Go to Brightspace uottawa.brightspace.com
– On the left-hand side click on Assignments tab
– Click on Assignment 0
– Under ”Submissions” you should see dashed rectangle labeled with “Drop files here, or click
below!”
– Drag and drop A0_xxxxxxx.zip there. You should now see A0_xxxxxxx.zip in that rectangle.
– Scroll down and click on “Submit”.
– You will see a pop-up saying “+Submitted successfully”. You will also receive a notification email.
– You can submit more than once. Try it! The old submission will not be deleted.
Identification
• The following information must be included at
the beginning of each program in your future
assignments. For example, in Assignment 1,
your program a1_xxxxxxx. py must start with:
# Course: IT1 1120
# Assignment number
# Family name, Given name
# Student number
Pause
At this point TA(s) will help anyone who has
issues with: installing python, opening
IDLE, running their first python program, or
submitting Assignment 0
– Everyone else please continue with lab
work as explained on the remaining slides.
Enroll into two Coursera courses
1. If you do not have Coursera account, first create one here and
remember your login credentials:
https://www.coursera.org/learn/learn-to-program?authMode=signup
2. Enroll into the following two free Python courses:
(If there is some option to pay something – do not pay anything.
Choose the free option.)
https://www.coursera.org/learn/learn-to-program
and
https://www.coursera.org/learn/program-code
Again, the only purpose of enrolling in these 2 coursera courses is so
that you get access to their quizzes for the self evaluation purposes.
10
Turtle Program Example
• Start IDLE
• The material you downloaded for Lab 1 has a Python program in a
file called turtle_smiles.py
• Open that file with IDLE
• Press Run Module and observe what happened.
• Now study the code and the following two slides before attempting
to do Exercise 1 (explained in 3rd slides from here)
• Notice the lines in turtle_smiles.py that start with #. All
lines starting with # will be ignored by python interpreter when
your press run. Therefore I used # to explain parts of the program
to you.
11
Useful functions in Turtle Class
This table is from “Introduction to Computing Using Python” by Lj. Perkovic 12
Useful functions in Turtle Class
13 This table is from “Introduction to Computing Using Python” by Lj. Perkovic
Exercise 1
• From IDLE open file turtle-ex1.py that is provided with Lab 1.
• Add your own code inside of that file so that your final program draws a dart
board similar to the one depicted below. (no need to use loops. copy/paste is
your friend in this lab). Do not forget that whenever you make changes to a
file, you have to save it first
before you can run it.
14
Exercise 2
• From IDLE open file turtle-ex2.py that is provided with Lab 1.
• Add your own code inside of that file so that your final program draws an
image similar to the one depicted below. (no need to use loops. copy/paste is
your friend in this lab). Place your code where indicated in file turtle-ex2.py
15
Having fun:
write a program in Blockly
• What is Blockly: visual programming language
developed by Google (to help students learn
programming)
• Instructions are blocks that fit together (like
lego bricks) to make up a computer program.
16
Final Exercises
•Use Blockly to solve level 9 and 10 mazes here:
https://blockly-games.appspot.com/maze?lang=en&level=9&skin=0
https://blockly-games.appspot.com/maze?lang=en&level=10&skin=0
-To get an idea on how to solve them (i.e. how to program in Blockly,
you many need to solve a few earlier levels)
-Try to find solutions with the smallest possible number of blocks
-Challenge: Can you solve level 9 with 4 blocks. What about level 10
with 5!!
17