Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Computer Programming for Engineers

( PBLA: 1 )

Registration
Name
Number
F18602010 Hasaan Zahid
Instructor’s Name
Date
19-06-2020 Ma’am Umy Kalsoom

Q:
(A) To begin, the man moves the spoon up to his mouth. This causes a lever to
move, releasing a spring that is connected to a spoon. The stored energy in the
spring causes the spoon to flip a piece of toast into the air. When the toast is in
the air, a bird flies to catch it. The bird flying away upsets the balance on a “teeter
totter,” dumping a liquid into a bucket. The liquid makes the bucket heavier,
causing the bucket to lower. The movement of the bucket triggers a lighter to
open and strike a flame. The flame lights a rocket that takes off. The rocket is
connected to a sickle that cuts a string that is attached to a pendulum that is
powered by a clock. At the end of the pendulum, a napkin is attached. When the
pendulum moves back and forth (due to the clock’s power), it wipes the man’s
face with the napkin.
(B)
Is x=8 same as 8=x?
In mathematics, it is same but in programming the value or variable on right side
is assigned to the value or variable on left. In x=8, if you print x, the output will be
8. But in 8=x, if you print 8, the output will be x. It is assigning the values to the
variables. So, in C++, x=8 is not same as 8=x.

Is indentation important:
When writing a code, it is necessary to write it in a way that it is “easy to read”.
It will look pleasant and it will be easier to read the code and find errors in it.

You might also like