0% found this document useful (0 votes)
8 views4 pages

2021 T

Past papers

Uploaded by

Saminda Lakshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
8 views4 pages

2021 T

Past papers

Uploaded by

Saminda Lakshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
AI RightsReserved ‘Department of Technical Education and Training C6020 NVQ Level 05 Written Examination — December 2021 (April/May 2022) (Semester 1) National Diploma in Information & Communication Technology L@ i) 2 @ (i) Software Programming - Theory [_ssinvenos ( ig Instructions: Answer five (05) questions . First three questions are Compulsory Three Hours Part A - Select one Question Part B - Select one Question (This paper consists of 04 pages.) What are the control structures used in programming, Explain all the control structures briefly giving suitable examples with code segments. (05 Marks) A technical college has 1200 students. The following pseudocode prints the addmission number of students who have attended the school every day ( 200 days ) in a particular academic year. BEGIN. c=0 While C < 1200 Input “ Admission Number of Student :” , addmissionNo Input “ Number of days attended ”, noOfDays If noOfDays = 200 then Print admissionNo Endif c-CH End While END (a) Draw the flow chart to represent the above pseudo code ( Use the same variable names as given in the pseudocode in your flowchart ) (07 Marks) (b) Convert the above pseudo code into a computer program, writing the code selecting a suitable Computer language (08 Marks) Briefly explain the following terms: (a) Instance of a class (b) Information Hiding (©) Polymorphism (09 Marks) Write a program to find the sum of first 100 prime numbers. (11 Marks) 3, (i) What are the differences between Compiler and Interpreter? (iii) Explain the relationship between class and object. (iii) Write a program to check whether the given number is even or odd. PART-A 4. (i) Write short notes for the following giving example for each. (a) Byte Code (b) Access Modifiers in Java (©) Getters and Setters (ii) Write a java program to compute the area of a circle. 5. (i) Write a Java program to demonstrate Exception Handling. i) Consider the following Java program. Write the correct output of the program, when itis executed. public class Question { public static void main(String args(]){ int da; uyt 4-0; a=45id; System.out printin("It Works"); } catch(ArithmeticException e) { System.out printin("It is over !"); } System.out printin("The program ends"); 0 (04 Marks) (06 Marks) (10 Marks) (09 Marks) (11 Marks) (06 Marks) (04 Marks) (iii) A Java class called “CalMath” is given here as follows. This class consists of a function named “getPower™ to return the n th power of @ given number import java.lang, Math; public class calMath { double z; public double getPower(int x, int y) { z= Math pow(x, y); return 75, } (a) Create a class as a child class with main method () to display the value of 26. You can make use of the inheritance feature here by considering the “calMath” class as super class. (10 Marks) PART- B 6 @_ Whatis two dimensional array ? Explain with an example? (05 Marks) (ii) Answer the following questions based on the given screen interface named as “STUDENT RESULTS OF MS OFFICE” (2) Write visual basic . net console application to display the Total marks, Average Marks and Grade based on the following conditions, when input Student Id, Student Name and marks of the MS office packages. User can input any number of records entering “ Y “ for “Any More Records” option. Conditions. ‘Average Marks less than 40 -> Fail Average Marks between 41-50 -> Pass Average Marks between 51-60 -> Credit ‘Average Marks between 61-70 - > Merit ‘Average Marks more than70 - > Distinction (15 Marks) (i) Whatis ADO.net ?- Explain in brief. (04 Marks) (i) @_ Write Visual Basic . net code to calculate the Balance payment, interest and monthly installment and display on the screen when entered the price of the furniture and initial payment. The calculation is done according to the selected furniture type and following interest rate Steel furniture interest rate is. 12% for two year period Wood furniture interest rate is 18% for three year period (10 Marks) ee: | Select the Fumiture Type : Prize of the Fumiture 50000) 3 tntatPement [20000] Balance [30000] Interest ___ 3600] | Monthly Installment [__ 1400 | (b) Write the code to clear all the text boxes when clicked Clear” Button (06 Marks) bebe

You might also like