0% found this document useful (0 votes)
8 views

Variables Worksheet

The document contains a worksheet for programming exercises involving variable manipulation, including switching values, performing calculations, and converting units. It includes prompts for writing algorithms to handle user input and output, such as age calculation and room surface area. Additionally, it features homework assignments related to temperature conversion and displaying numerical triples.

Uploaded by

ansari.oumaima
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Variables Worksheet

The document contains a worksheet for programming exercises involving variable manipulation, including switching values, performing calculations, and converting units. It includes prompts for writing algorithms to handle user input and output, such as age calculation and room surface area. Additionally, it features homework assignments related to temperature conversion and displaying numerical triples.

Uploaded by

ansari.oumaima
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PMIS Name :……………………

Variables Worksheet

Int q= 2 Int a= 2
Int s Int q
s= q+2 q=axaxa
q= s-1 What is the value of q:
…………………………………………
What are the values of q and s:
…………………………………………
…………………………………………
…………………………………………
…………………………………………
……….
…………………………………………

Int a= 2 Write a program that will switch


the values of two variables (hint:
Int q= 3
you must use a third variable to
q=a help you):
…………………………………………
a=q
…………………………………………
Does this program switch the …………………………………………
values of a and …………………………………………
q?................................................. …………………………………………
................ …………………………………………
…………………………………………

Write a program that calculates


the multiplication of two
variables
…………………………………………
…………………………………………
…………………………………………
…………………………………………
PMIS Name :……………………

Lesson practices: cut and paste

To ask a user for a data, we use the word ‘read()’, to


display data on the screen we use the word ‘write(‘’)’ .
what is the purpose of this algorithm:
…………………………………………………………………………
……………………
Int age
Write ( ‘what is your age?’)
Read (age)
Write an algorithm that converts hours to minutes.
age=age+10
…………………………………………………………………………
write(age)
…………………………………………………………………………
…………………………………………………………………………
Write an algorithm where you ask the student for a
…………………………………………………………………………
number and calculate its double then display it
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
…………………………………………………………………………
Variables Homework :
Write an algorithm that calculate the surface of rooms,
you ask the user first about the length and width of
his/her room.
Write an algorithm that ask the user for a temperature in
…………………………………………………………………………
Fahrenheit and covert it to Celsius
…………………………………………………………………………
…………………………………………………………………………
………………………………………………………………………………
…………………………………………………………………………
………………………………………………………………………………
…………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………

Write an algorithm that ask the user for a number the


displays its triple
………………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………
………………………………………………………………………………

You might also like