Professional Documents
Culture Documents
Addis Ababa Institute of Technology
Addis Ababa Institute of Technology
(AAIT)
This problem asks me to make a variable called var_1 and save my age in it. Then I am required
to subtract 5 from the value of the variable. And also add 3 to the value of the variable.
Discussion:
In this program I have first initialize the variable to 20, which is my age, and then I subtract 5
Pseudocode:
Initialize variable to 20
Source code:
Output:Conclusion:
In this problem a have learned how to initialize a variable and operate elementary operations.
Problem Description 2:
var_2 = 9*2
var_2 =9*2;
Discussion:
I have identified the difference of using and eliminating semicolon on a declaration by coding
Conclusion:
Using semicolon at the end of statement helps to suppress the output. As we can see in the
above source code the first statement doesn't terminate with semicolon, therefore it shows the
output (it doesn't suppress it). In the second statement semicolon at the end, so it suppresses
the output and nothing is shown as an answer. All in all we terminate a statement using
Problem Description 3:
I am asked to create a variable called var_lb to store heaviness in pounds and change it to
kilogram. I am then required to give the result to another variable called var_kg. [Hint: 1 kg =
I have first initialize arbitrary number to the variable (var_lb). Then I have changed the stored
pound to killogram using formula and then I assign the new value to other variable (var_kg)
Pseudocode:
Source code:
Output:
Conclusion:
This problem changes the value of pound to kilogram. In order to do this I first assign arbitrary
value in pound to a variable and then changed it to kilogram and assigned it to other variable.
Problem Description 4:
This problem asks me to create a variable called var_far to save a temperature in Fahrenheit.
Then to change it to Celsius and give the result to another variable called var_cel. [Hint: C= (F32) x 5/9.]
Discussion:
As the above problem I have assigned arbitrary value, which is temperature in Fahrenheit, to a
Pseudocode:
Source code:
Output:
Conclusion:
In this problem a temperature which was stored in a variable as Fahrenheit was converted in to
Celsius and assigned in a new variable.
Problem Description 5:
I am requested to write 5 different expressions that result in 9 by using only the numbers 2 and
Discussion:
As this problem requested I have written different expressions that result in 9 by using different
Conclusion:
This problem helped me to understand how to come up with a single result using different