WT I (SET-I) Date: Class XI Sec. Time: 1 Hr. 10 min. Computer Science M.M.: 30 Name Roll No. Instructions: a) All questions are compulsory. b) There are 15 questions in this paper and each question carries 2 marks. 1. Give two differences between RAM and ROM. I. RAM is read and write memory whereas ROM is read only memory. II. RAM is volatile while ROM is non-volatile memory. 2. Convert 30 TB into bytes (write answer in the form of : Y X 2 x such as 5X2 20 ). 15X2 41 3. What is a cache? Why do we use cache? Cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM. As the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory. 4. What is open source software? Name any two open source web browsers. Open-source software (OSS) is computer software with its source code made available and licensed with an open-source license in which the copyright holder provides the rights to study, change and distribute the software for free to anyone and for any purpose. Mozilla Firefox, Google Chrome 5. Differentiate between logical and syntax errors with suitable examples. In effect, syntax errors represent grammar errors in the use of the programming language. Common examples are: Misspelled variable and function names Missing semicolons Improperly matches parentheses, square brackets, and curly braces Incorrect format in selection and loop statements Logic errors occur when there is a design flaw in your program. Common examples are: XI / Comp. Sc. Page 1 of 8
Multiplying when you should be dividing Adding when you should be subtracting Opening and using data from the wrong file Displaying the wrong message 6. Why do we need header files? Name the header files required for the following functions: (i) setw() iomanip.h (ii) clrscr()-conio.h Header files contain declaration of functions. 7. Classify the following into valid and invalid identifier with suitable reason: (i) _class-valid (ii) break-invalid (iii) 1_side-Invalid (iv) T.S.A.-Invalid 8. Evaluate the expression: (x!= y) (! ((z > y) && (z < x))) when i) x=20, y=15, z=11 and ii) x=40, y=20, z=30 i) T ii) T 9. Find four syntax error(s) in the following program and re-write the corrected program. Underline each correction. #include (iostream.h) Void main() int x,y; cin>>x>>y; if x > y getch(); 10. Give the output of the following: B char a = A, b = 65; cout<< x is greater than y ; (a > b)? cout<<b++ : cout<<++a; 11. Draw a flow chart to check whether a four digit number is a palindrome or not. 12. Draw a flow chart to find the largest of three unequal numbers. XI / Comp. Sc. Page 2 of 8
13. Write a program to find the quadrant of an angle x (0 x 360 ) using conditional operator. If angle lies on axes, display the message Angle lies on Axis. int a; cin>>a; (a < 90 )? cout<< Q1 : (a<180)?cout<< Q2 : (a<270)? cout<< Q3 : (a < 360)? cout<< Q4 : (( a == 90 ) (a == 18) (a==270) (a==360))? cout<< On axis : cout<< Invalid input ; 14. Write a program to obtain three sides from the user and check whether three sides will form a triangle or not. If a triangle is formed, name the type of the triangle (Equilateral, isosceles or scalene). int a,b,c; cin>>a>>b>>c; if ((a+b>c)&&(b+c>a)&&(c+a>b)) cout<< Triangle will be formed ; if ((a==b)&&(b==c)) cout<< Equilateral ; if ((a==b) (b==c) (c==a)) cout<< Isosceles ; cout<< Scalene ; cout<< Triangle not formed ; 15. Write a program to check whether a character is a lower case alphabet or uppercase alphabet or digit or any other character. char ch; cin>>ch; if ((ch >= a ) && (ch <= z ) XI / Comp. Sc. Page 3 of 8
cout<< Lowercase ; if ((ch >= A ) && (ch <= Z ) cout<< Uppercase ; if ((ch >= 0 ) && (ch <= 9 ) cout<< digit ; cout<< Spl character ; XI / Comp. Sc. Page 4 of 8
WT I (SET-II) Date: Class XI Sec. Time: 1 Hr. 10 min. Computer Science M.M.: 30 Name Roll No. Instructions: c) All questions are compulsory. d) There are 15 questions in this paper and each question carries 2 marks. 1. Give two differences between hardware and software. Hardware includes every computer-related object that you can physically touch and handle like disks, screens, keyboards, printers, chips, wires, central processing unit, floppies, USB ports, pen drives etc. Whereas software includes every computer-related program that you cannot feel with the physical senses for example, system operating system, an anti-virus program, the web browser etc. 2. Convert 40 peta bytes into bytes. 40X2 50 = 5X2 53 3. What is an operating system? Name any two open source operating systems. An operating system is a system software. Ubunto, FreeBSD 4. Explain the terms shareware and freeware. Shareware is software that is distributed free on a trial basis with the understanding that the user may need or want to pay for it later. Some software developers offer a shareware version of their program with a built-in expiration date (after 30 days, the user can no longer get access to the program). Other shareware (sometimes called liteware) is offered with certain capabilities disabled as an enticement to buy the complete version of the program. Freeware, not to be confused with free software, is a type of proprietary software that is offered for use free of monetary charges. However, as is the case with other types of proprietary software, there are generally severe restrictions on its use and the source code is kept secret. Examples of freeware include Adobe's Acrobat Reader and Microsoft's Internet Explorer web browser. 5. Why do we use comments in a program? Explain the two ways of writing comments. XI / Comp. Sc. Page 5 of 8
Comments are lines of code which are ignored by the compiler. Comments are included in a program to make it more readable. If a comment is short and can be accommodated in a single line, then it is started with double slash sequence in the first line of the program. For example: //Program to find Simple Interest However, if there are multiple lines in a comment, it is enclosed between the two symbols /* and */ For example: /* this program will illustrate different components of a simple program in C++ */ 6. Name the header files required for the following functions: (i) cin (ii) sqrt() (iii) gets() (iv) getch() (i) iostream.h (ii) math.h (iii) stdio.h (iv) conio.h 7. Classify the following into valid and invalid identifier with suitable reason: (i) class (ii) Break (iii) 9abc (iv) _LSA (i) Invalid (ii) valid (iii) invalid (iv) Valid 8. Evaluate the expression: (x!= y) (! ((z > y) && (z > x))) when i) x=5, y=5, z=10 and ii) x=11, y=15, z=12 i) F ii) T 9. Find four syntax error(s) in the following program and re-write the corrected program. Underline each correction. float X = 10; if ( x!= y) then cout>> Ten ; x= 20; XI / Comp. Sc. Page 6 of 8
10. Give the output of the following: char a = B, b = 66; (a > b)? cout<<b++ : cout<<++a; C 11. Draw a flow chart to find gain/loss percent in a transaction. (Obtain SP and CP from user) 12. Draw a flow chart to check whether a character is a vowel or not 13. Write a program to find the smallest of 4 unequal numbers using conditional operator. int x,y, z, w; cout<< Enter values of x, y, z and w : ; cin>>x>>y>>z>>w; int g = (x<y)? x:y; g = (g<z)? g:z; g = (g<w)? g:w; cout<< Smallest number is = <<g; 14. Write a program to obtain three angles from the user and check whether a triangle can be formed or not. If a triangle is formed, name the type of the triangle (Equilateral, isosceles or scalene). int a,b,c; cin>>a>>b>>c; if (a+b+c == 180) cout<< Triangle will be formed ; XI / Comp. Sc. Page 7 of 8
if ((a==b)&&(b==c)) cout<< Equilateral ; if ((a==b) (b==c) (c==a)) cout<< Isosceles ; cout<< Scalene ; cout<< Triangle not formed ; 15. Write a program to find whether two lines ax+by+c=0 and ex+fy+g=0 are parallel, coincident or intersecting. float a,b,c,e,f,g,r1,r2,r3; cin>>a>>b>>c>>e>>f>>g; r1 = a/e; r2 = b/f; r3 = c/g; if ((r1==r2)&&(r2==r3)) cout<< Coincident ; if ((r1 == r2)&&(r2!= r3)) cout<< Parallel ; if ( r1!= r2 ) cout<< Intersecting XI / Comp. Sc. Page 8 of 8