DL - BIT 2204A - Java Programming - Part 2
DL - BIT 2204A - Java Programming - Part 2
DISTANCE LEARNING
SECTION B:
QUESTION ONE (20 MARKS)
(a) Write a java class that implements the following pseudocode [4 Marks]
1 Start
2. Read number N,
3. Set remainder as N modulus 2,
4. If remainder is equal to 0 then number N is even, else number N is odd
5. Print output.
6. Stop
(b) Write a java class that implements the following ATM pseudocode [5 Marks]
1
(c) Write a program called CircleComputation, which prompts user for a radius (of double) and
compute the area and perimeter of a circle. The output shall look like: [6 Marks]
Enter the radius: 1.2
The area is 4.5239
The perimeter is 7.5
SECTION C:
(b) Write a well commented java program that prints the following output. [4 Marks]
Age is: 30
Name is: job
Course is: Information Technology
Faculty is: FOCIM
(c) Write a java program for computing area of a triangle. The program should contain the following
features [4 Marks]
i. objects
ii. More than one methods
(d) Create class named student_names that prompts the user to enter three names of three students,
puts them in an Array, utilize do – while loop to read the names in the array and prints all the
of them [4 Marks]
(e) Write while-loop structure using a well commented java programming code that can print the
following five numbers [4 Marks]
1,2,3,4,5