0% found this document useful (0 votes)
16 views21 pages

3.1 +Variables+&+Assignments

Uploaded by

khaledalshorafa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views21 pages

3.1 +Variables+&+Assignments

Uploaded by

khaledalshorafa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Big Idea 3

ALGORITHMS AND PROGRAMMING

3.1: Variable & Assignments


Objectives
Essential Knowledge
Essential Knowledge
Naming Variables
Data Type
Example: Determine the value of a variable as a result of an assignment
Example: Determine the value of a variable as a result of an assignment
Question(1)

a) 3 –4 6
b) –1 –4 6
c) 5 4 –1
d) –4 6 9
Model Answer(1)

a) 3 –4 6
b) –1 –4 6
c) 5 4 –1
d) –4 6 9
Question(2)

a) I gave my Love a that had no stone CHERRY


b) I gave my Love a CHERRY that had no stone
c) a+b+c
d) I told my love a story that had no end (like this test)
Model Answer(2)

a) I gave my Love a that had no stone CHERRY


b) I gave my Love a CHERRY that had no stones
c) a+b+c
d) I told my love a story that had no end (like this test)
Question(3)

A) 0 12 0
B) Error; a cannot be added to a.
C ) 6 12 0
D) 0 12 5
Model Answer(3)

A) 0 12 0
B) Error; a cannot be added to a.
C ) 6 12 0
D) 0 12 5
Question(4)

a) 20
b) 15
c) 10
d) 4
Model Answer(4)

a) 20
b) 15
c) 10
d) 4
Question(5)

Which of the following code segments would swap the values of a and b?

Select single answer choice.


Model answer(5)

Which of the following code segments would swap the values of a and b?

Select single answer choice.


Question(6)

a) True True
b) False True
c) False False
d) True False
Model Answer(6)

a) True True
b) False True
c) False False
d) True False
Reflection

Q1.Now that you've learned about variables and assignments, how do you think they help in creating a
program? Can you describe a simple example where using a variable made solving a problem easier or more
organized?

Q2.What did we learn today “Mention at least 2 things”

You might also like