You are on page 1of 5

COMPUTER SCIENCE - FIRST TERM ASSIGNMENT CLASS V (2013-2014) Answers

Q 1 S!"!e Tr#e $r F"%se


1. In QBASIC, CLS command is used to clear the output screen. Tr#e 2. PRINT 2!"#$% displa&s 2!"#$. Tr#e ". Input de'ice is used to displa& the processed in(ormation. F"%se ). SCR**N 1 has $)+ columns and 2++ ro,s. F"%se -. In LIN* command B is used to dra, a .o/. Tr#e $. 0ard dis1 is a secondar& stora2e de'ice. 3. All the Input and 4utput de'ices are attached to the S&stem unit. 5. In QBASIC, line num.ers that ,e 2i'e should .e ,hole num.ers. Tr#e 6. In QBASIC, output ,ill .e ,ithout 2ap ,hen ,ords are seperated .& comma7,8. F"%se 1+. In QBASIC, LIN* command is used to dra, a line or a .o/ (rom the speci(ied position. Tr#e Tr#e Tr#e

Q 2 F&%% &n !'e (%"n)s


1. In QBASIC, the (i2ures are dra,n in 2raphics ,ith an in'isi.le *+$&n!er** 2. In QBASIC, 9RA: 0-+% command will draw a line in upward direction towards the
left side.

". *In+#!** de'ice is used to (eed data into a computer. ). In QBASIC, SCR**N 2 is called **'&,'** resolution 2raphic mode.
Pa2e 1 o( -

-. All statements in BASIC must terminate ,ith the *en!er** 1e&.

Q 3 Answer !'e .$%%$w&n,


1. :hat is S&nta/; Ans. The rule that ,e (ollo, to ,rite the commands and a statement is called S&nta/. 2. :rite the (ull (orm o( BASIC, C4B4L and <4RTRAN. Ans. BASIC = Be2inners> All Purpose S&m.olic Instruction Code C4B4L ? Common Business 4riented Lan2ua2e <4RTRAN ? <ormula Translation ". :hat is a SCR**N Command; Ans. This command is used to chan2e the resolutions o( the screen i.e. to chan2e the num.er o( ro,s and columns on the screen. S/n!"0 ? SCR**N n :here n is the choice o( the mode 7+, 1, or 28 ). :rite the s&nta/ o( 9RA: command; Ans. S/n!"0 ? 9ra, direction steps% -. :rite the s&nta/ o( PRINT Statement. Ans. S/n!"0 $. PRINT 1$22"n3 ? Line No. PRINT Te/t%

$. :rite the (unction o( a C4L4R command. Ans. This command is used to chan2e the colour o( te/t and 2raphics. This command is used (or SCR**N + and SCR**N 1onl&, as SCR**N 2 2raphics are onl& in .lac1 and ,hite. 3. :hat is an Interpreter; Ans. An Interpeter is a computer pro2ram that e/ecutes instructions ,ritten in a pro2rammin2 lan2ua2e. 5. :rite the e/amples o( Primar& and Secondar& Stora2e de'ice. Ans. */amples o( Primar& Stora2e de'ices are @ RAA, R4A */amples o( Secondar& Stora2e de'cies are @ 0ard 9is1, <lopp& 9is1, Aa2netic tapes 6. :rite the main components o( computer. Ans. The main components o( computer are Input Bnit, S&stem Bnit, Stora2e Bnit and 4utput Bnit.
Pa2e 2 o( -

1+. 9e(ine S&stem Bnit. Ans. S&stem Bnit ? Aost parts o( the computer are (ound in a .o/ called S&stem Bnit.

Q 4 4&..eren!&"!e !'e .$%%$w&n,


a. Comma and Semicolon in PRINT statement ,ith the e/ample. Ans. C$22" &n PRINT S!"!e2en!5 In PRINT statement, ,hen comma is used .et,een t,o ,ords or num.ers then the output ,ill appear on the same line, ,ith Conal 2aps in .et,een. E0"2+%e= 1+ PRINT %0*LL4%,%<RI*N9S% 2+ *N9 4utput ,ill .e 0*LL4 <RI*N9S Se2&1$%$n &n PRINT S!"!e2en!5 I( the ,ords or num.ers are separated .& semicolon the output ,ill .e on the same line, ,ithout a 2ap. E0"2+%e= 1+ PRINT %0*LL4%D%<RI*N9S% 2+ *N9 4utput ,ill .e 0*LL4<RI*N9S .. 9RA: *)+% and 9RA: <)+% Ans. 1. DRAW E40
Will draw a diagonal line by 40 steps in the upward direction towards the right side. 2. DRAW F40 Will draw a diagonal line by 40 steps in the downward direction towards the right side.

c. Input and 4utput Bnit. Ans. In+#! Un&! ? 9ata and in(ormation need to .e 2i'en to a computer throu2h an INPBT BNIT. This unit ,ill send the data to the s&stem unit. The de'ices used to (eed data or in(ormation are called Input de'ices. */amples@ Ee&.oard, Aouse, Fo&stic1, Scanner etc. O#!+#! Un&! ? :hen data or in(ormation is 2i'en to the S&stem Bnit throu2h the input Bnit, the processed in(ormation is sent to the 4BTPBT BNIT. The de'ices on ,hich processed in(ormation is displa&ed are called 4utput de'ices.
Pa2e 3 o( -

*/amples@ Aonitor, Printer. d. SCR**N 1 and SCR**N 2 command. 7a8 Ans. SCREEN 1 and SCREEN 2
SCREEN 1 1. This screen has 20 colu!ns and 200 rows. 2. #t is a $ediu! Resolution %raphics $ode. . #n SCREEN 1' we can change the colour o( graphics. SCREEN 2 This screen has "40 colu!ns and 200 rows. #t is a &igh Resolution %raphics $ode. #n SCREEN 2' we can not change the colour o( graphics.

Q - E0+%"&n &n 3e!"&%


1. :rite the rules o( ,ritin2 a QBASIC pro2ram. Ans. R#%es ? 1. All the instructions that ,e 2i'e to the computer must .e in capital letters. 2. All instructions must start ,ith the num.ers. ". Appropriate BASIC lan2ua2e ,ords must .e used ,hile 2i'in2 instructions. 2. */plain LIN* command ,ith the s&nta/. Ans. LINE 1$22"n3 ? This command is used to dra, a line or a .o/ (rom the speci(ied position. S/n!"0 ? LIN* 7&, /8 ? 7., a8, C, B< & is the column num.er and / is the ro, num.er o( startin2 position. . is the column num.er and a is the ro, num.er o( end position. C speci(ies the colour. B is 2i'en ,hen &ou ,ant to dra, a .o/. < is 2i'en ,ith B to (ill the .o/. ". */plain CIRCL* command ,ith the s&nta/. Ans. CIRCL* Command ? This command is used to dra, a circle (rom the 2i'en Position as the centre and (or the 2i'en radius. S/n!"0 $. CIRCLE 1$22"n3@ CIRCL* 7&, /8 , r, c & is the column num.er, / is the ro, num.er, r as the radius o( the circle and c is (or the colour.

Q 6 I3en!&./ !'e err$rs "n3 wr&!e !'e 1$rre1! +r$,r"2


Pa2e 4 o( -

") 1+. cls


2+. PRINT 1$G) "+. PRINT 6H2# )+ PRINT TABI2+JD Aonitor% -+ PRINT )!" # $!2% $+ PRINT computer

1+ CLS 2+ PRINT 1$G) "+ PRINT 6H2#% )+ PRINT TAB72+8D Aonitor% -+ PRINT )!" # $!2% $+ PRINT computer%

() 1+. SCR**N 1
2+. C4L4BR " "+. 9RA: B)+%D%9)+% )+ 9RA: *-$% -+ dra, r$+% $+ end

1+ SCR**N 1 2+ C4L4R " "+ 9RA: B)+D9)+% )+ 9RA: *-$% -+ 9RA: R$+% $+ *N9

Q 7 8r&!e !'e $#!+#! .$r !'e .$%%$w&n, 9ASIC Pr$,r"2


1+ PRINT )!-#%D )!2+ PRINT " "+ PRINT TAB7$+8D :elcome % )+ PRINT 5!)% -+ PRINT hello% D ton&% $+ PRINT 2+H)+ 5!) helloton& $+ )!-#2+ " :elcome

Pa2e - o( -

You might also like