· Write an algorithm to read 20 numbers into an array. 5. ... Write down the.flowchart and...

3
TED (10) _ l0i8 (REVrSroN_2010) Reg. No. Signature SECOND/THIRD SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/TECHNOLOGY - OCTOBER, 2016 PROGRAMMING METHODOLOGY (For II Semester all branches except DCp & CABM and fsr III Semester cB) .[Time : 3 hotns (Maximurn marks :.1Q0) PART - A (Maximum marks : l0) I Answer thc following questions in one or two sentences. Each question carries 2 marks. 1- while executing a computer program the following line shows an €rror. Identify the error and justify it. Num: 56*'98' 2. what will be output when you wilr execute following pseudo code. Set y: 1 If sqrt(Y-1)::0 then Write'!es" Else Write'T.tro" End If 3. What is Data flow diagram ? 4. Write an algorithm to read 20 numbers into an array. 5. What is the difference betweerr local and global variable ? Marks (5x2: 10) PART __ B (Maximum marks : 30) Answei any five questions from the following. Each question carries 6 marks. 1. Distinguish between pre increment operator and post increment operator with the help of an example, 2. Write a psuedocode to check givor number is odd or even. 3. Draw a flow chart to find out largest arnong three nurnbers. 4. Write a short note on sting drta gpe. [3 8] 't www.madinpoly.com

Transcript of  · Write an algorithm to read 20 numbers into an array. 5. ... Write down the.flowchart and...

Page 1:  · Write an algorithm to read 20 numbers into an array. 5. ... Write down the.flowchart and pseudocode for the ... Write an algorithm to find the strings are equal ...

TED (10) _ l0i8(REVrSroN_2010)

Reg. No.

Signature

SECOND/THIRD SEMESTER DIPLOMA EXAMINATION INENGINEERING/TECHNOLOGY

- OCTOBER, 2016

PROGRAMMING METHODOLOGY(For II Semester all branches except DCp & CABM and fsr III Semester cB)

.[Time : 3 hotns(Maximurn marks :.1Q0)

PART - A(Maximum marks : l0)

I Answer thc following questions in one or two sentences. Each question carries2 marks.

1- while executing a computer program the following line shows an €rror.Identify the error and justify it.

Num: 56*'98'

2. what will be output when you wilr execute following pseudo code.

Set y: 1

If sqrt(Y-1)::0 thenWrite'!es"ElseWrite'T.tro"End If

3. What is Data flow diagram ?

4. Write an algorithm to read 20 numbers into an array.

5. What is the difference betweerr local and global variable ?

Marks

(5x2: 10)

PART __ B

(Maximum marks : 30)

Answei any five questions from the following. Each question carries 6 marks.

1. Distinguish between pre increment operator and post increment operator withthe help of an example,

2. Write a psuedocode to check givor number is odd or even.

3. Draw a flow chart to find out largest arnong three nurnbers.

4. Write a short note on sting drta gpe.

[3 8]

't

www.madinpoly.com

Page 2:  · Write an algorithm to read 20 numbers into an array. 5. ... Write down the.flowchart and pseudocode for the ... Write an algorithm to find the strings are equal ...

2

Marks

5. Explain dre differ''ence behveen call by value and call by referenc€ with example.

6. Write an algorittun to display days of week using switch---case.

7. The transpose of a m by n matrix is defined to be a n by m matrix that results

from interchanging the rows and columns of the matix. Write a progam

segment to find transpose of a m by n rnatix (5x6: 30)

PART- C

(Maximun ma*s : 60)

(Answer one fiall question from each unit. Each full question carries 15 marks.)

Uxrr - I

m (a) List the different flowchart symbols. 5

(b) Write an algorithm to interchange two numbers. 5

(") Suggest most appropriate variable narhe and data type for the following iterns.

Itern Variable name Data type

Name of the publishcr

Book name

Book code

Quantity

Price

On

ry (a) Explain the steps of problem solving.

O) Write down the.flowchart and pseudocode for the following problem.

An employee's basic salary is input through the keyboard. His dearnessallowance is 45Yo of basic salary and house rent allowance is 20Yo of basicsalary. Calculate the gross salary.

Nrr - IIV (a) Develop a pseudocode for arittrmetic calculator (addition subtaction,

multiplication, division operations only) using switch--case

(b) Widr help of flow chrt and examples, briefly explain.petest and post-test loops. -

On

VI (a) Write down the pseudocode for the following problem.A five digit number is enterd into the keyboard. Calculate sum of its digits.

(Hint : nput 64273, then oueut is 6+4+2+7+3:22) g

(b) Explain relational and logical operators. 7

8

5

www.madinpoly.com

Page 3:  · Write an algorithm to read 20 numbers into an array. 5. ... Write down the.flowchart and pseudocode for the ... Write an algorithm to find the strings are equal ...

I

I

i

L

3

Marks

Uurr - III\{I (a) Write a pseudocode to calculate largest and smallest number in an array. g

(b) Write an algorithm to find the strings are equal or not. 6

On

VIII (a) Write a pseudocode ro Search an element in an array using Linear Search. 7

(b) Write an algorithm to find the sum of two matnces. 8

Uxrr - IV

D( (a) What are the basic opeftfions in a sequential file. 7

(b) Write a menu driven program that inputs a number { and at the users optioqfinds and displays the area (A) of one of the following. Use subprograms foreach onc.

(t A sqr.rare with side X, A = square of X.

(ii) A circle with radius X, A = pi *square of X where pi : 3.14. 8

On

X (a) What is recusion ? Wnte a pseudocode to find factorial of a number usingrecursion. 8

(b) Wnte a pseudocode to find NCR factor using function.

{Hint : NCR:n! (r!*(n-r)!). Values of n and r are input ttuough t}re

keyboard)

www.madinpoly.com