You are on page 1of 8

CSE 215L: Programming Language

II Lab
Faculty: Silvia Ahmed,
Sec – 9, 10
Lab 01 – Spring 2021
Task 01 and Task 02
• Do them yourself. Very easy to do them.
Task 03 and Task 04
• Use Math.PI for pi.
• Another approach is using final keyword for a constant.
Remember to use all capital letters for the variable name.
• For example: final double PI = 3.14
Task 05
• While doing division between two integers, convert one to
double.
• You can write 9.0/5 or 9/5.0 as both are correct but do not
write 9/5.s
Task 06
• When you have a percentage, you need to divide the number
by 100. So, 15% = 15/100.
Task 07, Task 08 and Task
09
• Use proper brackets as you need to calculate properly.
• V2/2a should be written as: (v * v) /(2 * a) or Math.pow(v, 2)/
(2 * a). Math .pow always results in a double value.
Task 10
• Use tab or “\t” for the space. First calculate the result and print
the result sequentially using tab.
• Then go to a new line and do the same.
• Search internet and find your confusion about using tab.
Attention!!
• You have to write the output exactly as given in the sample
input and output.
• Notice the Capital letters, spaces and numbers.
• Now go back again to the Task 01 and find your mistakes from
all the tasks.
• Correct yourself! 

You might also like