4/24/2016

BCS2233 OOP: Test 1

Date:  28 April 2016
Time : 11:00-12:30

1. Which of the following are invalid identifiers, why?
I.    DCIT
II.    DCIT   Students
III.    $matric
IV.    matric_number
V.    1stJAVAProgram


2. Show ‘Evaluation Tree’ for the following expressions:
I.    8 + 2 / 4
II.    6 * 2 + 3 % 2
III.    3 + 2 / 5 + -2 * 4
IV.    2 * (1 + -(3/4) / 2) * (2 - 6 % 3)

3. Write a java fragment for the following problems.


0.    Write a for statement to print integer 1 to 20. [example]

int I;
For (i=1; i<=20; i++)
System.out.Println(i);


I.    Write a for statement to print integer 1 to 10.



II.    Write a while statement to print integer 1 to 10.




4.    Write a an algorithm and a java program that displays the following table:-
 (note that 1 kilogram is 2.2 pounds):

    Kilograms     Pounds  
    1             2.2     
    3             6.6     
    ...
    100           220  

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...