This document is a class test for 2nd year Computer Science students, focusing on Chapter 11. It includes multiple-choice questions, short answer questions, and a programming task related to control structures and salary deductions. The test is designed to assess students' understanding of selection structures in programming.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views1 page
Computer Part 2 ch#11
This document is a class test for 2nd year Computer Science students, focusing on Chapter 11. It includes multiple-choice questions, short answer questions, and a programming task related to control structures and salary deductions. The test is designed to assess students' understanding of selection structures in programming.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
COMPUTER SCIENCE
ICS – 2nd Year
CLASS TEST – Ch#11 Name: _______________________ Time Allowed: 60 Minutes Roll No: _______________________ Total Marks: 30
Q.1 Choose the right answer. (06)
(i) What is the simplest selection structure? (A) if (B) switch (C) if else (D) nested if (ii) In if statement true is represented by (A) 0 (B) 2 (C) 1 (D) none (iii) The keyword that is not used in switch statement (A) default (B) if (C) case (D) switch (iv) Conditional operator is an alternative of (A) if (B) if else (C) nested if (D) none of these (v) Which operator in C is called a ternary operator? (A) if (B) ++ (C) ? : (D) ( ) (vi) Graphical representation of a program is called (A) flow chart (B) time diagram (C) DFD (D) ERD
Q.2 Write short answers to the following questions. (8*2=16)
(i) What is control structure. (ii) What happens if break statement is missed in case block? (iii) Write the syntax of switch case statement. (iv) Define conditional operator. Write its syntax. (v) Draw the flowchart of if-else-if statement. (vi) What is nested if statement? (vii) Trace the output of the following code. int a=1; int b=6; if(a+b<7) printf(“%d”,a); else printf(“%d”,b); (viii) Trace the output of following code. if(7/2==1) printf(“Programming makes the life boring!”);
NOTE: Attempt the following question.
Q.3 Write a program that input salary. If the salary is 30000 or more, it deducts 13% of the salary. If the salary is 15000 or more but less than 30000, it deducts 1500 from the salary. (08)