[go: up one dir, main page]

0% found this document useful (0 votes)
4 views10 pages

Elec

The document contains a series of programming questions and tasks related to Python, covering topics such as image processing, GUI application development, object-oriented programming concepts like inheritance and polymorphism, and exception handling. It includes specific programming exercises, such as creating classes, methods, and graphical user interfaces using libraries like Tkinter and Turtle. The questions are structured to assess knowledge and practical skills in Python programming.

Uploaded by

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

Elec

The document contains a series of programming questions and tasks related to Python, covering topics such as image processing, GUI application development, object-oriented programming concepts like inheritance and polymorphism, and exception handling. It includes specific programming exercises, such as creating classes, methods, and graphical user interfaces using libraries like Tkinter and Turtle. The questions are structured to assess knowledge and practical skills in Python programming.

Uploaded by

sreelxmi73
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

5 Lisi any lhn:c image processing Pylhon libraries.

(3)

6 Lisi the steps 10 create a GUl application usfog Tk.inter (3)


7 How to cren1e a destruclor in Python? Give an example. (3)
8 Write a Pytho n class which hA5 two mdhods get_distance and print_distance. (3)
ge1_dis11111Ce IICCCpt a distance in kilometres from the U5el' and print_distance
prinl the distance in me1er.
Modakill
15 a) How lo draw a slar s hape using uutle in Python. (5)
b) Ellplain basic image processing with inbuilt functions in Python. (9)
OR
16 a) Write Python GU1 program to take llhe birth date and ou1p111 the age when a (7)
button is pressed.
b) How do you display an image in Python GUI ?. (7)
ModulelV
17 a) Demonstrate bow polymorphism can be implemented l1Slilg function (7)
overloading with suitable clUUllplc.
b) lllustrule with a ru1 life uample how :multi-level inheritance is implemen1cd in (7)
Python.
OR
18 a) Crealc an Abstract Base Class called Shape tbal include abstract methods area() (7)
a.nd circumference(). Then derive two classes Circle and Rectang le from
the Shape class illld implement the area() illld circumference() methods . Write 11
P ython program 10 implemenl abo,·c concepL
b) How eltccptions arc handled in Python ?. Illustrate with the help of an uamplc. (7)

Page 2of 3
-- - - f -

M~DI
15 a) How to dr.aw a square and hexagon using turtle module in Python. (7)
b) O.,cribe the method., lllld Python modules commonly used for convening a (7)
rolor image to a grayllClllc image,
OR
16 o) 0.•ign o Pyth<ln GUI pmg111111 that takes wcr input for the length lllld width of a (8)
n,ctanglc. and when o button is pn,ssed. c111culalc• and display• the area of the
rectangle.
b) How do you display an image with a caption using Python in a graphical (6)
interface'!
Module IV
17 a) A cws Car with attributes registtlllion_number. color. milc,oge and year. oad • (7)
method to display iofonnation about the car. Write a Python program to create
an in.,tancc of the Car clus and dcrnon.,tratc how to access and modify it•
oltributc,.
b) Deline a b•~ clo.-, "Shape" with onribute< width and h<ight. and a method to (7)
cokula1e the area. Create two subcla.csci: "Rectangle" and "Triangle" inheriting

P:igc 2of 3

UCNICSihJ01JA01

fmm the "Shape," clos.,. O.morutntc polymorphum by calling the area


colculatim methcxl on inmnccs of both •ubctus...
2/3 ••
••
18 a)
OR
What is on llhstroct class in Python 001'? Explain with an example.
••
b) lllustrlde with suitable ..arnples bow ,e sceptions are handled in Python. (7)
S How can you Rt the dn,,.;,,g speed of the turtle in lhe Turtle module? Gi\•e an (3)

<iuunplc

6 List the steps 10 create a GUI 111JPlic3lioo using Tonia- (3)


7 How can you achieve method ovemding in Pylhoo 001'? (3)

8 How does the _ini t _ method differ from other methods in • Python cluss? (3)
ModalrW
13 a) Deticribe any two image proc:essiog libnries in python. with illustrlltion of two {7)
methods of each libray.

Page 2of 4

120uUl 34i2052302

b) Write • GUI program to display an i11U&• with title? (7)


OR
16 a) Write • GUI applic:ttion thllt ..rv.. ,u int""51 cakullllor. Your GUI must take \8)

Principle. Rate of interesl and time in , - . 35 input.< from the user. It must let
the user choo,c whether they want t.o calcul•e Simple inlerest or Compound
intore.i and tho final output i., di,playcd in • >ingle output filc,d accordingly?
b ) Write • python program to draw a panllelognun u,ing tunic and fill with a (6)
rolor
ModtoltlV
17 a) Write any two type, o( Inheritance In '.Python? Give an eaan1ple r,.- each. (R)
h) Write Python Program to •imulote • Bonk A<X<llm< with ,uppon for (6)
dep,,.itMoney. wlthclrawMooey and 1how8alance Opttotion•·'

OR
18 a) Write Python coclc to overload•·+••. -,d ••." operators by providing the mctl,ods (8)
add_. _sub_ .?
b) Wb.Jc i5 thr . -ol oxc,ptlons? Write • Pythoo axle to nwe 1111 exception udng (6)
the ni. uy,.'O<II.?
lllulrt1'111C the rw,ctiOCI or following methods in tunic (3)
i) 1ur1Jc.sethuding(O) ii)lunlc.forward(SO) iii) 1unlc.lcrt(90)
6 Describe 1..-0 Junclamental difference, bec,.'ttll tenninal •based user in1erfaces (3)

andGUls.
7 Explain what the _ !ltr _ method does and ..-by it is a useful method to include (3)
in a class.
8 Compon, multiple and multiJ.,-.1 inhcrilADCr (3)
0300CSIJ.620SU01

r.todult Ill
15 n) Write n python function to draw• square using tunle graphics (5)
b) Write a python function to covert :an iJDll8e to black :and while using image (9)

processing methocb.
OR
16 n) Write• python (unction to draw nn hexagon using turle gnphic. (5)
b) Write a python (unction to shrinlr. an image by a gi,•en factor. The function suppose (9)
to builds aod return• • new image wtikh i• omaller copy of tho argument image,
hy the focu.- orgumcnt.
r.locllllrlV
17 a) Write Pylhoo program 10 rn,atc • class called a• C:-pln to model complex (9)
numbcn aod implement _add_ ( ) ,and _ mul_ () methods to add and multiply
two <'Omplu numbcn, Obplay the tt11Ult hy ovcrloodins the + and • OJk'••tor.
b) Explain multiple inheri~ in Python with a .uitllhle eXDO,ple (5)
OR
18 •J Write• Python prognun to create• clus called u llolloul to model ration,d (9)
number, and a>.,ociated opcnlions. lrnplenient the fnllowinJ nie1hod• in th< c1 .....
Uu opcrutot o,•crloading.
I. RcduceO - to return the simplif'ied liaction form
2. _ add_() • to add two ratioanal numbeo
3. _ It_() • to <ompare two rotlonal numbcn (leu than operation)
b) Whot b Ex<epdoa handling~ Writ< a program that op,n• • fllc and wril<J "H•llo (5)
Good moring" to it. HDDdle exn,ptioru that cnn be genentcd during l/0 operations
Module Ill

1.5 a) Write• Python prognun to oonvert a color image to a grayscale image. (6)

b) Exploin the altributes and methods of Tunle object_ (8)

011
16 n) Write Python GUI progrmm to input IWO llring, lllld output I concalellaled !Iring (6)

when • buuon i., pn,UN.


b) Discu.u on the typos of window ccmpoocnu and lhcir function<. (R)

Module IV
17 o) Ilium•• the use or ob,UrtlCI c l = in Python. (6)

b) Deline • doll Student in Python with 111ributes to Jlore th< roll number. name (8)

nnd matko of thn,c oubjecu for each ,tuclenL Deline the following rnelhodo:
n,adOala()• to assign values lo the arlributes
romputeTotal() - to lind the total maiks
prilll_deUtils() • ID duplay thi: 11tributc values and the toul nuu'ltli
Create an object of the c""'5 and invoke lhc methods.
011
18 •> Exploin. with the help of suitable <lWDplcs. the different types of iohcrilllllCe. (8)
b) Write a Python prognun to demonsua,e the use of lly. except and finally blocks. (6)
Module Ill
15 o) Write a Pylhon prognun to draw• hexagon and to fill it with red colour. Explain (7)
the tunic mctltocb 11.'l<d In It.
b) Write a python program to <0nven ,. colour lmag< to block and white lmag<. (7)

Exploin the im•1• m<thoch u....t in it.


OR
16 u) Write a GUI.based program thot allows the wer to con,·en amount in lndlun (10)
Rupees to ..mount in Euro.
The lnterfoc,, should ba,-e labeled <DU)' fiekls ror these two values. 1l>ese
componmb should be 1m111ed In a grid wh<re the label• O(;Cupy the 111'111 mw
ond tbe corruponding field• occupy the ,econcl row.
At Jton-up. tbe Ruptt,1 f><ld ahoold contain 0 .0. and the Euro field •hould L'Ontain
0.0. The third mw in thr window contaiiu t lA'O command buuons, lubeled R ->E
and E-> R. When thr = r pressu thr· fint button. the program 1hould use the dalJl
in the Rupee field to compute thr :imounl in Euro, which should then be output
to the Euro field. The second buuoo dlould perform the inverse function.
bl What are the attributes or a window? How the attributos value can be changed? (4)
Module IV
17 o) Write o Python program to clcline a <IHI Rectangle with parameters height. width (7)
and member functions to find ..,.._ and perimeter of it.
b) lllwtnle how inhmlllne1' and polyn,oq,hism can be impl•n><nt<d in Python. (7)
OR
18 o) Create o Student cl15S and initialize i t with name and roll number. (7)
Make methods to :
I. Di,play • Display ■II inrolfflilHlll• or 1hc ,1udcnL
2. •elAge • AHign age to lludcnt
3. •etTcstMarkJ • Assign nwtcs of a t,st to tbe 1tudcn1.
b) What ore exceptions? How does Python each it? lllustrnte the wage. (7)
' J U-I.V U.

5 What are the attributes of• turtle object? (3)


6 What are the adv,uuages of GUI based programs o,..,.. termioaJ based programs. (3)
7 What is meant by absu-aclioo mechanism in progr:unmiog? Give one example (3)
absuocrion mecbmism in Pyd,oo..
8 Explain the lenJIS accessors and mutUors will, regard to Pyd,oo class definition. (3)

You might also like