1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2)

Size: px
Start display at page:

Download "1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2)"

Transcription

1 THE AIR FORCE SCHOOL Class XI First Terminal Examination Computer Science (083) Time: 3 hrs. M. Marks : 70 General Instructions : (i) All the questions are compulsory. (ii) Programming Language is C Answer the following : a) What do you mean by Open Source Software. Give an example. OSS is the software which gives the user freedom to run/use the software for any purpose in any manner. It can be modifies and redistributed. The source code is freely available to the customer. It can be freely used but it may not be free of charge. Eg : Python, Tux Paint, Net Beans etc. ( 1 mark : definition 1 mark : example ) b) What is the purpose of cache memory in a computer system? Discuss the types of cache memory available in the system. Cache memory is a very high-speed memory which is placed between the CPU and main memory. It holds those parts of the data and program which are more frequently used by CPU. Cache memory is of 2 types : (i) Level 1 (L1) Cache : It is also called internal cache. It resides on microprocessor chip. It has a capacity of KB. (ii) Level 2 (L2) Cache : It is a separate chip which resides outside the microprocessor chip. It has a capacity of 64 KB 2 MB. ( 1 mark : purpose of cache 1 mark : types of cache ½ mark each ) c) Discuss any 2 functions of operating systems. Functions of OS are as follows : (i) Processor Management : It performs CPU scheduling, manages the time that shall be allocated to each process in queue. (ii) Device Management : OS helps to communicate between the CPU and I/O devices. It performs buffering and spooling to manage the speed mismatch between I/O devices and CPU. ( 1 mark for each function ) 2. Answer as directed: a) What is the difference between type conversion and type casting? Type Conversion It is also called implicit conversion or type promotion. When an expression involves multiple data types, then the complier automatically Type Casting It is also called explicit conversion. When the programmer explicitly converts one data type into another, it is termed as

2 converts the smaller data type to the larger one. This is called automatic type conversion. explicit type conversion. Eg : float f = (float) 10/3 ; ( 1 mark for 1 point of difference ) b) Write the corresponding C++ expressions for the following mathematical expressions: i) abc/(a-c) 2 ii) v-w/(w+b) 1/2 i) (a*b*c) / pow((a-c),2) ii) (v-w) / sqrt((w+b)) ( 1 mark for each part ) c) Evaluate the following, where a, b, c are integers and d, f are floating point numbers. The value of a=32, b=2 and d=10 i) f = a * b + a / b - b ii) c = a / b + b % a i) 78 ii) 18 ( 1 mark for each part ) 3. Answer as directed: a) Identify the data types that may be used to store the following data : i) 9 : char iii) 9.0 : float ii) 9 : int iv) 9.54 : float ( ½ mark for each part ) b) What is the range and size in bytes of the following data types: i) int ii) char Datatype Size (in bytes) Range int 2 bytes to or 0 to char 1 byte -128 to +127 or 0 to 255 ( 1 mark for each part ) c) What do you mean by a constant? How can we create constants in c++? Constants are the data values which cannot be modified in the program during execution. The values of constants remain fixed. To create constants, we prefix the word const before datatype during variable declaration. Eg : const int x = 10; ( 1 mark : definition 1 mark : creating constant ) d) Identify the valid and invalid identifiers out of the following : i) Break : Valid ii) data24 : Valid iii) data- 24 : Invalid iv) data_24 : Valid ( ½ mark for each part )

3 e) Differentiate between keywords and identifiers. Keywords Keywords are the reserved words of the programming language which have a predefined meaning. Eg : if, break etc. Identifiers Identifiers are the means to identify any part of the program such as variable name, name of function etc. Eg : int a; Here a is an identifier. ( 1 mark for 1 point of difference ) f) What do you mean by logical errors? Why are logical errors hard to trace? Logical errors occur when the programmer implements the algorithm for solving the problem incorrectly. It produces unexpected and wrong results. These errors occur because of the wrong analysis of the program by the programmer. That is why, they are hard to trace as they cannot be traced by the compiler and neither by the run-time environment. Eg : displaying wrong message, adding in place of subtracting etc. g) What are the various stream objects available in C++? Write their usage. Predefined stream objects in C++ are : (i) cin : It is an object of istream class. It stands for console input. (ii) cout : It is an object of ostream class. It stands for console output. (iii) cerr : It is an object of ostream class. It stands for console error. ( ½ mark : naming the stream objects ½ mark each : for defining each stream object ) 4. Find the error from the following code segments and rewrite the corrected code underlining the corrections made. a) # include(iostream.h) void main ( ) ; int a,b; cin>>a; for( b=20, b>10, b - -) if a > b cout<<a; cout<<b; # include <iostream.h> void main ( ) int a,b; cin>>a; for( b=20 ; b>10 ; b - -) if (a > b) cout<<a; cout<<b; ( ½ mark for each error )

4 b) int a, b ; char ch; cout<< Enter your choice : ; cin>>ch; switch(ch); Case 1 : c=a+b; cout<<c; Break; Case 2 : c = a*b; cout<<c; Break; Case : cout<< Invalid ; int a, b ; char ch; cout<< Enter your choice : ; cin>>ch; switch(ch) case 1 : c=a+b; cout<<c; case 2 : c = a*b; cout<<c; default : cout<< Invalid ; ( ½ mark for each error ) 5. Determine the output of the following: a) int i=0,a=0,b=0,c=0,d=0; while(i<=5) switch(i) case 1 : case 2 : i+=2; case 3 : case 4 : ++b; c++; ++c; a++; b++; default : ++d;

5 cout<< \n a = <<a<< \t b = <<b; cout<< \n c = <<c<< \t d = <<d; a = 1 b = 2 c = 2 d = 1 b) # include<iostream.h> void main ( ) int a,b=5; cout << b++ << \n ; a = - - b ; cout<<a<< \n ; a= b++; cout<<a<< \n ; c) for(int i=1 ; ; ) cout<<i<< ; if(i==128) i*=2; d) # include<iostream.h> void main ( ) int i=0; for (i=100; i>=10; i=i-10) cout<<i<<endl; Convert the given code into equivalent switch case code. char ch;

6 cout<< Enter a character : ; cin>>ch; if (( ch == ' ' ) (ch == 1 ) ) cout<< "One" ; if ( ch == 'B' ) cout<< "Two" ; cout<< "None" ; 7. Convert the code given in for loop to equivalent while loop. #include<conio.h> int num, a,b,c,d ; clrscr(); for (a=1, num = 12; a<num ; a++) char ch; cout<< Enter a character : ; cin>>ch; switch(ch) case : case 1 : cout<< "One" ; case B : cout<< "Two" ; default : cout<< "None" ; b = num%a; if (b==0) cout<<a<<endl; cout<< Press any key to continue ; #include<conio.h> int num, a,b,c,d ; clrscr(); a=1; num=12; while ( a<num ) b = num%a; if (b==0) cout<<a<<endl; a++; 8. Consider cout<< Press the code given any below key and to continue ; write its equivalent code using conditional operator.

7 cout<< Enter the amount : ; cin>>amt; if(amt < 3000) dis = 0.05 * amt ; if(amt < 5000) dis = 0.10 * amt ; if(amt < 7000) dis = 0.15 * amt ; dis = 0.20 * amt ; cout<< \n Discount = <<dis; cout<< Enter the amount : ; cin>>amt; dis = (amt<3000)? 0.05*amt : (amt<5000? 0.10*amt : (amt<7000? 0.15*amt : 0.20*amt)); cout<< \n Discount = <<dis; 9. Differentiate between entry control and exit controlled loop. Entry-Controlled Loop Exit-Controlled Loop In this loop, the condition is checked at the time of entry in the loop. In this loop, the condition is checked at the time of exit from the loop. If the condition is false, the loop does not This loop executes at least once. execute even once. Eg : for loop, while loop Eg : do-while loop ( 1 mark for 1 point of difference )

8 10. Draw flowcharts for the following : a) To check whether a number entered by the user is a palindrome or not. START Read the number in variable num rev = 0 rem = num % 10 num = num / 10 rev = rev *10+rem; NO num = 0? YES num = rev? Palindrome Not a Palindrome STOP b) To find the sum of positive numbers and product of negative numbers when the user enters 10 numbers. START n = 1 sum=0 pro=1

9 Read num num >0? sum = sum+num pro=pro*num n=n+1 YES n<=10? NO Display sum, pro STOP 11. Write C++ programs for the following: (4x3=12) a) To generate Fibonacci series of n numbers where value of n is entered by the user. Also check that the number in Fibonacci series should be printed only if it is prime. #include<math.h> int num1,num2,num3,n,flag; cout<<"\n Enter number of terms in fibonacci series : "; cin>>n; num1=0; num2=1; cout<<num1<<endl<<num2<<endl; int i=1; while(i<=n) num3=num1+num2; flag=0; for(int j=2; j<num3/2 ; j++) if(num3%j==0)

10 flag=1; if(flag==0) cout<<num3<<endl; i++; num1=num2; num2=num3; b) To evaluate the following series : 1 x/2! + x 2 /4! x 3 /6! + x 4 /8! +... upto n terms #include<math.h> float x,n,num,den,sum=0; cout<<"\n Enter the number of terms : "; cin>>n; cout<<"\n Enter the value of x : "; cin>>x; for(int i=0 ; i<n ; i++) num=pow(x,i); den=1; for(int j=1 ; j<=2*i ; j++) den = den*j; if(i%2==0) sum = sum + (num/den); sum = sum - (num/den); cout<<"\n Sum of the series : "<<sum; c) To print the following pattern : A B A C B A D C B A int i,j; char k; for(i=0 ; i<4 ; i++) for(j=3 ; j>=i ; j--)

11 cout<<" "; for(k=65+i ; k>=65 ; k--) cout<<k; cout<<endl; 12. Write a program to input choice from user and perform the following operations as per the user choice: (4) Choice Operation 1 To convert time given in seconds into hours, minutes and seconds. 2 To input a character and check whether it is an alphabet, digit, space or special character. 0 Exit #include<process.h> int ch; cout<<"\n 1 : convert time to hh,mm,ss"; cout<<"\n 2 : Check whether a character is an alphabet, digit, space or special symbol"; cout<<"\n Enter Choice : "; cin>>ch; switch(ch) case 1 : int sec, hh,mm,ss,x; cout<<"\n Enter time in seconds : "; cin>>sec; x=sec; hh=sec/3600; sec=sec%3600; mm=sec/60; ss=sec%60; cout<<"\n"<<x<<" seconds = "<<hh<<" hours "<<mm<<" minutes "<<ss<<" seconds"; case 2 : char c; cout<<"\n Enter a character : "; cin>>c; if((c>='a' && c<='z') (c>='a' && c<='z')) cout<<"\n Alphabet"; if (c>='0' && c<='9') cout<<"\n Digit"; if (c==' ') cout<<"\n Space"; cout<<"\n Special Symbol"; case 0 : exit(0); default : cout<<"\n Invalid Choice";

12 13. Write a program to input choice from user and perform the following operations as per the user choice: (4) Choice Operation 1 To check whether the entered year is a leap year or not 2 To find sum of individual digits of a number 0 Exit #include<process.h> int ch; int num,rem,sum=0; cout<<"\n 1 : To check whether the year is a leap year or not"; cout<<"\n 2 : To find sum of individual digits of a number"; cout<<"\n Enter Choice : "; cin>>ch; switch(ch) case 1 : int year; cout<<"\n Enter year : "; cin>>year; if(year%100 == 0) if(year%400==0) cout<<"\n"<<year<<" is a Leap Year"; cout<<"\n"<<year<<" is not a Leap Year"; if(year%4==0) cout<<"\n"<<year<<" is a Leap Year"; cout<<"\n"<<year<<" is not a Leap Year"; case 2 : cout<<"\n Enter a number : "; cin>>num; while(num!=0) rem=num%10; sum+=rem; num=num/10; cout<<"\n Sum of digits of the number is : "<<sum; case 0 : exit(0); default : cout<<"\n Invalid Choice";

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet BRAIN INTERNATIONAL SCHOOL Term-I Class XI 2018-19 Sub: Computer Science Revision Worksheet Chapter-1. Computer Overview 1. Which electronic device invention brought revolution in earlier computers? 2.

More information

BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI. Unit Wise Marks

BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI. Unit Wise Marks BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI Unit Wise Marks Unit No. Unit Name Marks 1. COMPUTER FUNDAMENTAL 10 2. PROGRAMMING METHODOLOGY 12 3. INTRODUCTION TO C++ 1. INTRODUCTION TO C++ 3 TOTAL

More information

Looping statement While loop

Looping statement While loop Looping statement It is also called a Repetitive control structure. Sometimes we require a set of statements to be executed a number of times by changing the value of one or more variables each time to

More information

WT I (SET-I) Date: Class XI Sec. Time: 1 Hr. 10 min. Computer Science M.M.: 30

WT I (SET-I) Date: Class XI Sec. Time: 1 Hr. 10 min. Computer Science M.M.: 30 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

More information

2. Distinguish between a unary, a binary and a ternary operator. Give examples of C++ operators for each one of them.

2. Distinguish between a unary, a binary and a ternary operator. Give examples of C++ operators for each one of them. 1. Why do you think C++ was not named ++C? C++ is a super set of language C. All the basic features of C are used in C++ in their original form C++ can be described as C+ some additional features. Therefore,

More information

COMPUTER SCIENCE (083)

COMPUTER SCIENCE (083) Roll No. Code : 112012-083 Please check that this question paper contains 7 questions and 8 printed pages. CLASS-XI COMPUTER SCIENCE (083) Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions

More information

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++] ASSIGNMENT-1 2016-17 CLASS-11 COMPUTER SCIENCE [C++] 1 Consider the following C++ snippet: int x = 25000; int y = 2*x; cout

More information

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition)

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition) Structures Programming in C++ Sequential Branching Repeating Loops (Repetition) 2 1 Loops Repetition is referred to the ability of repeating a statement or a set of statements as many times this is necessary.

More information

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each. I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK 70. a) What is the difference between Hardware and Software? Give one example for each. b) Give two differences between primary and secondary memory.

More information

Sample Paper Class XI Subject Computer Sience UNIT TEST II

Sample Paper Class XI Subject Computer Sience UNIT TEST II Sample Paper Class XI Subject Computer Sience UNIT TEST II (General OOP concept, Getting Started With C++, Data Handling and Programming Paradigm) TIME: 1.30 Hrs Max Marks: 40 ALL QUESTIONS ARE COMPULSURY.

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION MAX MARKS:70 CODE - A DURATION : 3 Hours

SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION MAX MARKS:70 CODE - A DURATION : 3 Hours SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION 2016 MAX MARKS:70 CODE - A DURATION : 3 Hours All questions are compulsory. Do not change the order of the questions

More information

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1 NAGERCOIL COMPUTER SCIENCE Grade: IX C++ PROGRAMMING 1 C++ 1. Object Oriented Programming OOP is Object Oriented Programming. It was developed to overcome the flaws of the procedural approach to programming.

More information

KENDRIYA VIDYALAYA SANGATHAN, GUWAHATI REGION HALF-YEARLY EXAMINATION-2015 CLASS XI : COMPUTER SCIENCE Time Allotted : 3 hrs. Max.

KENDRIYA VIDYALAYA SANGATHAN, GUWAHATI REGION HALF-YEARLY EXAMINATION-2015 CLASS XI : COMPUTER SCIENCE Time Allotted : 3 hrs. Max. KENDRIYA VIDYALAYA SANGATHAN, GUWAHATI REGION HALF-YEARLY EXAMINATION-2015 CLASS XI : COMPUTER SCIENCE Time Allotted : 3 hrs. Max. Marks : 70 Q.1..... operator in C++, requires three operands. [1] Q.2

More information

VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS

VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS 1. Write C++ programs to interchange the values of two variables. a. Using with third variable int n1, n2, temp; cout

More information

Downloaded from

Downloaded from Unit I Chapter -1 PROGRAMMING IN C++ Review: C++ covered in C++ Q1. What are the limitations of Procedural Programming? Ans. Limitation of Procedural Programming Paradigm 1. Emphasis on algorithm rather

More information

D.A.V PUBLIC SCHOOLS, RANCHI ZONE FIRST SUMMATIVE ASSESSMENT CLASS - XI COMPUTER SCIENCE

D.A.V PUBLIC SCHOOLS, RANCHI ZONE FIRST SUMMATIVE ASSESSMENT CLASS - XI COMPUTER SCIENCE D.A.V PUBLIC SCHOOLS, RANCHI ZONE FIRST SUMMATIVE ASSESSMENT 2011-2012 CLASS - XI COMPUTER SCIENCE Q1. Input a number and then print the sum of the digits. [4] Q2. Input a number and then print its reverse.

More information

COMPUTER SCIENCE (083)

COMPUTER SCIENCE (083) Roll No. Code : 112011-083-A Please check that this question paper contains 7 questions and 6 printed pages. CLASS-XI COMPUTER SCIENCE (083) Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions

More information

16. What is the significance of the break statement in a switch block?

16. What is the significance of the break statement in a switch block? Section A : Question carrying 1 Mark 01. How is data different from information? 02. Arrange the following in descending order :- Nibble, KB, Bit, GB,TB,Byte,MB 03. What is the significance of task bar

More information

CHRIST THE KING BOYS MATRIC HR. SEC. SCHOOL, KUMBAKONAM CHAPTER 9 C++

CHRIST THE KING BOYS MATRIC HR. SEC. SCHOOL, KUMBAKONAM CHAPTER 9 C++ CHAPTER 9 C++ 1. WRITE ABOUT THE BINARY OPERATORS USED IN C++? ARITHMETIC OPERATORS: Arithmetic operators perform simple arithmetic operations like addition, subtraction, multiplication, division etc.,

More information

CHAPTER-6 GETTING STARTED WITH C++

CHAPTER-6 GETTING STARTED WITH C++ CHAPTER-6 GETTING STARTED WITH C++ TYPE A : VERY SHORT ANSWER QUESTIONS 1. Who was developer of C++? Ans. The C++ programming language was developed at AT&T Bell Laboratories in the early 1980s by Bjarne

More information

DELHI PUBLIC SCHOOL TAPI

DELHI PUBLIC SCHOOL TAPI Loops Chapter-1 There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed

More information

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE a) Mention any 4 characteristic of the object car. Ans name, colour, model number, engine state, power b) What

More information

PART I. Part II Answer to all the questions 1. What is meant by a token? Name the token available in C++.

PART I.   Part II Answer to all the questions 1. What is meant by a token? Name the token available in C++. Unit - III CHAPTER - 9 INTRODUCTION TO C++ Choose the correct answer. PART I 1. Who developed C++? (a) Charles Babbage (b) Bjarne Stroustrup (c) Bill Gates (d) Sundar Pichai 2. What was the original name

More information

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms.

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms. PROBLEM: 1. FIBONACCI SERIES Write a C++ program to generate the Fibonacci for n terms. AIM: To write a C++ program to generate the Fibonacci for n terms. PROGRAM CODING: #include #include

More information

A Freshman C++ Programming Course

A Freshman C++ Programming Course A Freshman C++ Programming Course Dr. Ali H. Al-Saedi Al-Mustansiria University, Baghdad, Iraq January 2, 2018 1 Number Systems and Base Conversions Before studying any programming languages, students

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College October 24, 2018 Outline Outline 1 Chapter 8: A C++ Introduction For Python Programmers Expressions and Operator Precedence

More information

Creating a C++ Program

Creating a C++ Program Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer. 1 Creating a C++ Program created using an

More information

C++ PROGRAMMING SKILLS Part 2 Programming Structures

C++ PROGRAMMING SKILLS Part 2 Programming Structures C++ PROGRAMMING SKILLS Part 2 Programming Structures If structure While structure Do While structure Comments, Increment & Decrement operators For statement Break & Continue statements Switch structure

More information

C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal

C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal TOKENS C++ character set Letters:- A-Z, a-z Digits:- 0 to 9 Special Symbols:- space + - / ( ) [ ] =! = < >, $ # ; :? & White Spaces:- Blank Space, Horizontal Tab, Vertical tab, Carriage Return. Other Characters:-

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS 1 ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS)

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS 1 ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS) FACULTY: Ms. Saritha P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS 1 ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS) SUBJECT / CODE: Programming in C and Data Structures- 15PCD13 What is token?

More information

cout<< \n Enter values for a and b... ; cin>>a>>b;

cout<< \n Enter values for a and b... ; cin>>a>>b; CHAPTER 8 CONSTRUCTORS AND DESTRUCTORS 8.1 Introduction When an instance of a class comes into scope, a special function called the constructor gets executed. The constructor function initializes the class

More information

Sample Paper - II Subject Computer Science

Sample Paper - II Subject Computer Science Sample Paper - II Subject Computer Science Max Marks 70 Duration 3 hrs Note:- All questions are compulsory Q1) a) What is significance of My Computer? 2 b) Explain different types of operating systems.

More information

Lecture 4. 1 Statements: 2 Getting Started with C++: LESSON FOUR

Lecture 4. 1 Statements: 2 Getting Started with C++: LESSON FOUR 1 Statements: A statement in a computer carries out some action. There are three types of statements used in C++; they are expression statement, compound statement and control statement. Expression statement

More information

C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different.

C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different. C++ Character Set a-z, A-Z, 0-9, and underscore ( _ ) C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different. Identifier and Keywords:

More information

BRAIN INTERNATIONAL SCHOOL Term-II Class-XI Sub:- Computer Science Revision Sheet

BRAIN INTERNATIONAL SCHOOL Term-II Class-XI Sub:- Computer Science Revision Sheet BRAIN INTERNATIONAL SCHOOL Term-II Class-XI 2018-19 Computer Organisation Sub:- Computer Science Revision Sheet 1. Which electronic device invention brought revolution in earlier computers? 2. Which memory

More information

CLASS-XI COMPUTER SCIENCE

CLASS-XI COMPUTER SCIENCE Roll No. Code : 112014-083-A Please check that this question paper contains 7 questions and 8 printed pages. CLASS-XI COMPUTER SCIENCE Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions : All

More information

c++ Solutions eedsohag.epizy.com Ahmed Ali

c++ Solutions eedsohag.epizy.com Ahmed Ali c++ s Ahmed Ali int main(int argc, char *argv[]) int age; age=10; cout

More information

Arrays. int Data [8] [0] [1] [2] [3] [4] [5] [6] [7]

Arrays. int Data [8] [0] [1] [2] [3] [4] [5] [6] [7] Arrays Arrays deal with storage of data, which can be processed later. Arrays are a series of elements (variables) of the same type placed consecutively in memory that can be individually referenced by

More information

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 Name :. Roll No. :..... Invigilator s Signature :.. 2011 INTRODUCTION TO PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give

More information

PESIT Bangalore South Campus Hosur Road (1km before Electronic City), Bengaluru Department of Basic Science and Humanities

PESIT Bangalore South Campus Hosur Road (1km before Electronic City), Bengaluru Department of Basic Science and Humanities SOLUTION OF CONTINUOUS INTERNAL EVALUATION TEST -1 Date : 27-02 2018 Marks:60 Subject & Code : Programming in C and Data Structures- 17PCD23 Name of faculty : Dr. J Surya Prasad/Mr. Naushad Basha Saudagar

More information

True or False (12 Points)

True or False (12 Points) Name True or False (12 Points) 1. (12 pts) Circle T for true and F for false: T F a) A void function call occurs as part of an expression. T F b) Value Returning Functions cannot have reference parameters.

More information

Downloaded from

Downloaded from FIRST TERMINAL EXAMINATION, INFORMATICS PRACTICES Time : 3 hrs. Class - XI M.M. : 70 Instructions: This question paper contains seven questions. All the questions are compulsory. Answer the questions carefully.

More information

CHAPTER 4 FUNCTIONS. 4.1 Introduction

CHAPTER 4 FUNCTIONS. 4.1 Introduction CHAPTER 4 FUNCTIONS 4.1 Introduction Functions are the building blocks of C++ programs. Functions are also the executable segments in a program. The starting point for the execution of a program is main

More information

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI 621213 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Sub code: CS2203 SEM: III Sub Name: Object Oriented Programming Year: II UNIT-I PART-A 1. What is

More information

DHA Suffa University CS 103 Object Oriented Programming Fall 2015 Lab #01: Introduction to C++

DHA Suffa University CS 103 Object Oriented Programming Fall 2015 Lab #01: Introduction to C++ DHA Suffa University CS 103 Object Oriented Programming Fall 2015 Lab #01: Introduction to C++ Objective: To Learn Basic input, output, and procedural part of C++. C++ Object-orientated programming language

More information

(6) The specification of a name with its type in a program. (7) Some memory that holds a value of a given type.

(6) The specification of a name with its type in a program. (7) Some memory that holds a value of a given type. CS 7A - Fall 2016 - Midterm 1 10/20/16 Write responses to questions 1 and 2 on this paper or attach additional sheets, as necessary For all subsequent problems, use separate paper Do not use a computer

More information

Homework 2 Solutions Group B 1- Write a C++ program to read a students score in Statistics and print if he is successful or failing.

Homework 2 Solutions Group B 1- Write a C++ program to read a students score in Statistics and print if he is successful or failing. Homework 2 Solutions Group B 1- Write a C++ program to read a students score in Statistics and print if he is successful or failing. int score; cout>score; if ((score>=60)&&(score

More information

b) #include<iostream.h> void main() { int a, b; cout<<"input two integer values? "; cin>>a>>b; double avg=(a+b)/2.0; cout<<"average="<<avg<<endl; }

b) #include<iostream.h> void main() { int a, b; cout<<input two integer values? ; cin>>a>>b; double avg=(a+b)/2.0; cout<<average=<<avg<<endl; } SAMPLEPAPER-2016 (Class 11) 1a)Name the header file(s) that shall be needed for successful compilation of the following C++ code. void main( ) char Name[20]; gets(name); int n=1+random(5); for(int k=0;k

More information

CHAPTER 9 FLOW OF CONTROL

CHAPTER 9 FLOW OF CONTROL CHAPTER 9 FLOW OF CONTROL FLOW CONTROL In a program statement may be executed sequentially, selectively or iteratively. Every program language provides constructs to support sequence, selection or iteration.

More information

Basic Statements in C++ are constructed using tokens. The different statements are

Basic Statements in C++ are constructed using tokens. The different statements are CHAPTER 3 BASIC STATEMENTS Basic Statements in C++ are constructed using tokens. The different statements are Input/output Declaration Assignment Control structures Function call Object message Return

More information

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples: Unit IV Pointers and Polymorphism in C++ Concepts of Pointer: A pointer is a variable that holds a memory address of another variable where a value lives. A pointer is declared using the * operator before

More information

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming

More information

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example:

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example: POINTERS Pointer is a memory variable which can store address of an object of specified data type For example: #include int x=5; int *a;//here a is a pointer to int which can store address of

More information

I Internal Examination Sept Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs.

I Internal Examination Sept Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs. I Internal Examination Sept. 2018 Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs. [I]Very short answer questions (Max 40 words). (5 * 2 = 10) 1. What is

More information

C++ Basic Elements of COMPUTER PROGRAMMING. Special symbols include: Word symbols. Objectives. Programming. Symbols. Symbols.

C++ Basic Elements of COMPUTER PROGRAMMING. Special symbols include: Word symbols. Objectives. Programming. Symbols. Symbols. EEE-117 COMPUTER PROGRAMMING Basic Elements of C++ Objectives General Questions Become familiar with the basic components of a C++ program functions, special symbols, and identifiers Data types Arithmetic

More information

---

--- Bharathi Hr. Sec. School, Reddipatty..1.. A. Prabhakar, M.C.A.,B.Ed., Enter the given text: Heaven from all creatures hides the book of fate. All but the page prescribe the present state. A hero perishes

More information

Examination for the Second Term - Academic Year H Mid-Term. Name of student: ID: Sr. No.

Examination for the Second Term - Academic Year H Mid-Term. Name of student: ID: Sr. No. Kingdom of Saudi Arabia Ministry of Higher Education Course Code: ` 011-COMP Course Name: Programming language-1 Deanship of Preparatory Year Jazan University Total Marks: 20 Duration: 60 min Group: Examination

More information

LOGO BASIC ELEMENTS OF A COMPUTER PROGRAM

LOGO BASIC ELEMENTS OF A COMPUTER PROGRAM LOGO BASIC ELEMENTS OF A COMPUTER PROGRAM Contents 1. Statements 2. C++ Program Structure 3. Programming process 4. Control Structure STATEMENTS ASSIGNMENT STATEMENTS Assignment statement Assigns a value

More information

'C' Programming Language

'C' Programming Language F.Y. Diploma : Sem. II [DE/EJ/ET/EN/EX] 'C' Programming Language Time: 3 Hrs.] Prelim Question Paper Solution [Marks : 70 Q.1 Attempt any FIVE of the following : [10] Q.1(a) Define pointer. Write syntax

More information

The Hyderabad Public School Begumpet, Hyderabad, A.P.

The Hyderabad Public School Begumpet, Hyderabad, A.P. The Hyderabad Public School Begumpet, Hyderabad, A.P. Department of Computer Science Mid Term Examination 2013 Worksheet-1 Sub: Computer Applications Class:10 1. Define the term Byte code. 2. What do you

More information

Darshan Institute of Engineering & Technology for Diploma Studies

Darshan Institute of Engineering & Technology for Diploma Studies 1. Explain Call by Value vs. Call by Reference Or Write a program to interchange (swap) value of two variables. Call By Value In call by value pass value, when we call the function. And copy this value

More information

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science HOLIDAYS HOMEWORK 2017-18 CLASS : XII Subject : Computer Science Note : Attempt the following questions in a separate register and make yourself prepared to conquer the world. Chapter- 1 : C++ Revision

More information

Understanding main() function Input/Output Streams

Understanding main() function Input/Output Streams Understanding main() function Input/Output Streams Structure of a program // my first program in C++ #include int main () { cout

More information

Control Structure and Loop Statements

Control Structure and Loop Statements Control Structure and Loop Statements A C/C++ program executes in sequential order that is the way the instructions are written. There are situations when we have to skip certain code in the program and

More information

A Freshman C++ Programming Course

A Freshman C++ Programming Course A Freshman C++ Programming Course Dr. Ali H. Al-Saedi Mustansiriyah University, Baghdad, Iraq November 4, 2018 1 Number Systems and Base Conversions Before studying any programming languages, students

More information

CSE202-Lec#4. CSE202 C++ Programming

CSE202-Lec#4. CSE202 C++ Programming CSE202-Lec#4 Functions and input/output streams @LPU CSE202 C++ Programming Outline Creating User Defined Functions Functions With Default Arguments Inline Functions @LPU CSE202 C++ Programming What is

More information

Chapter-8 DATA TYPES. Introduction. Variable:

Chapter-8 DATA TYPES. Introduction. Variable: Chapter-8 DATA TYPES Introduction To understand any programming languages we need to first understand the elementary concepts which form the building block of that program. The basic building blocks include

More information

CSCE Practice Midterm. Data Types

CSCE Practice Midterm. Data Types CSCE 2004 - Practice Midterm This midterm exam was given in class several years ago. Work each of the following questions on your own. Once you are done, check your answers. For any questions whose answers

More information

CHAPTER 2.2 CONTROL STRUCTURES (ITERATION) Dr. Shady Yehia Elmashad

CHAPTER 2.2 CONTROL STRUCTURES (ITERATION) Dr. Shady Yehia Elmashad CHAPTER 2.2 CONTROL STRUCTURES (ITERATION) Dr. Shady Yehia Elmashad Outline 1. C++ Iterative Constructs 2. The for Repetition Structure 3. Examples Using the for Structure 4. The while Repetition Structure

More information

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS DEPARTMENT OF SCIENCE AND HUMANITIES EVEN SEMESTER FEB 2017

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS DEPARTMENT OF SCIENCE AND HUMANITIES EVEN SEMESTER FEB 2017 P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS DEPARTMENT OF SCIENCE AND HUMANITIES ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS) EVEN SEMESTER FEB 07 FACULTY: Dr.J Surya Prasad/Ms. Saritha/Mr.

More information

C++ Final Exam 2017/2018

C++ Final Exam 2017/2018 1) All of the following are examples of integral data types EXCEPT. o A Double o B Char o C Short o D Int 2) After the execution of the following code, what will be the value of numb if the input value

More information

HE AIR FORCE SCHOOL: SUBROTO PARK: DELHI CANTT WT-II SUB: INFORMATICS PRACTICES ANSWER KEY. 1. (a) What will be the output of the code 2

HE AIR FORCE SCHOOL: SUBROTO PARK: DELHI CANTT WT-II SUB: INFORMATICS PRACTICES ANSWER KEY. 1. (a) What will be the output of the code 2 HE AIR FORCE SCHOOL: SUBROTO PARK: DELHI CANTT. 110010 WT-II CLASS : XI SET I SUB: INFORMATICS PRACTICES ANSWER KEY MAX MARK: 30 TIME ALLOWED : 1Hr 10 Mins 1. (a) What will be the output of the code 2

More information

Multiple Choice Questions ( 1 mark)

Multiple Choice Questions ( 1 mark) Multiple Choice Questions ( 1 mark) Unit-1 1. is a step by step approach to solve any problem.. a) Process b) Programming Language c) Algorithm d) Compiler 2. The process of walking through a program s

More information

The Hyderabad Public School, Begumpet, Hyderabad, A.P

The Hyderabad Public School, Begumpet, Hyderabad, A.P The Hyderabad Public School, Begumpet, Hyderabad, A.P. 500 016 2012-13 Department of Computer Science Class 8 Worksheet 3 1) How many times will the following statement execute? ( ) int a=5; while(a>6)

More information

CSc 10200! Introduction to Computing. Lecture 4-5 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing. Lecture 4-5 Edgardo Molina Fall 2013 City College of New York CSc 10200! Introduction to Computing Lecture 4-5 Edgardo Molina Fall 2013 City College of New York 1 C++ for Engineers and Scientists Third Edition Chapter 3 Assignment, Formatting, and Interactive Input

More information

CSCE Practice Midterm. Data Types

CSCE Practice Midterm. Data Types CSCE 2004 - Practice Midterm This midterm exam was given in class several years ago. Work each of the following questions on your own. Once you are done, check your answers. For any questions whose answers

More information

Object Oriented Pragramming (22316)

Object Oriented Pragramming (22316) Chapter 1 Principles of Object Oriented Programming (14 Marks) Q1. Give Characteristics of object oriented programming? Or Give features of object oriented programming? Ans: 1. Emphasis (focus) is on data

More information

Question Bank (SPA SEM II)

Question Bank (SPA SEM II) Question Bank (SPA SEM II) 1. Storage classes in C (Refer notes Page No 52) 2. Difference between function declaration and function definition (This question is solved in the note book). But solution is

More information

Introduction to Programming EC-105. Lecture 2

Introduction to Programming EC-105. Lecture 2 Introduction to Programming EC-105 Lecture 2 Input and Output A data stream is a sequence of data - Typically in the form of characters or numbers An input stream is data for the program to use - Typically

More information

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal MA 511: Computer Programming Lecture 3: http://www.iitg.ernet.in/psm/indexing_ma511/y10/index.html Partha Sarathi Mandal psm@iitg.ernet.ac.in Dept. of Mathematics, IIT Guwahati Semester 1, 2010-11 Last

More information

1.3b Type Conversion

1.3b Type Conversion 1.3b Type Conversion Type Conversion When we write expressions involved data that involves two different data types, such as multiplying an integer and floating point number, we need to perform a type

More information

Subject: PIC Chapter 2.

Subject: PIC Chapter 2. 02 Decision making 2.1 Decision making and branching if statement (if, if-, -if ladder, nested if-) Switch case statement, break statement. (14M) 2.2 Decision making and looping while, do, do-while statements

More information

m) sin() n) endl o) getch() p) cout

m) sin() n) endl o) getch() p) cout SAMPLE PAPER 1. a) Name the header file for the following built-in functions: a) log() b) exp() c) getch() d) isalnum() e) fabs() f) isalpha() g) toupper() h) cos() i) random() j) gets() k) abs() l) tolower()

More information

CS242 COMPUTER PROGRAMMING

CS242 COMPUTER PROGRAMMING CS242 COMPUTER PROGRAMMING I.Safa a Alawneh Variables Outline 2 Data Type C++ Built-in Data Types o o o o bool Data Type char Data Type int Data Type Floating-Point Data Types Variable Declaration Initializing

More information

Lecture 4 Tao Wang 1

Lecture 4 Tao Wang 1 Lecture 4 Tao Wang 1 Objectives In this chapter, you will learn about: Assignment operations Formatting numbers for program output Using mathematical library functions Symbolic constants Common programming

More information

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

More information

If the function modify( ) is supposed to change the mark of a student having student_no y in the file student.dat, write the missing statements to modify the student record. 10. Observe the program segment

More information

Module C++ I/O System Basics

Module C++ I/O System Basics 1 Module - 36 C++ I/O System Basics Table of Contents 1. Introduction 2. Stream classes of C++ 3. Predefined Standard Input/Output Streams 4. Functions of class 5. Functions of class

More information

Padasalai.Net s Model Question Paper

Padasalai.Net s Model Question Paper Padasalai.Net s Model Question Paper STD: XII VOLUME - 2 MARKS: 150 SUB: COMPUTER SCIENCE TIME: 3 HRS PART I Choose the correct answer: 75 X 1 = 75 1. Which of the following is an object oriented programming

More information

Computers Programming Course 7. Iulian Năstac

Computers Programming Course 7. Iulian Năstac Computers Programming Course 7 Iulian Năstac Recap from previous course Operators in C Programming languages typically support a set of operators, which differ in the calling of syntax and/or the argument

More information

Computer Applications Answer Key Class IX December 2017

Computer Applications Answer Key Class IX December 2017 Computer Applications Answer Key Class IX December 2017 Question 1. a) What are the default values of the primitive data type int and float? Ans : int = 0 and float 0.0f; b) Name any two OOP s principle.

More information

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles Abstract Data Types (ADTs) CS 247: Software Engineering Principles ADT Design An abstract data type (ADT) is a user-defined type that bundles together: the range of values that variables of that type can

More information

Chapter 2. Procedural Programming

Chapter 2. Procedural Programming Chapter 2 Procedural Programming 2: Preview Basic concepts that are similar in both Java and C++, including: standard data types control structures I/O functions Dynamic memory management, and some basic

More information

Variable x is created and assigned a value 35. Variable is y created as a copy of x. Variables x and y are two separate memory locations.

Variable x is created and assigned a value 35. Variable is y created as a copy of x. Variables x and y are two separate memory locations. Reference (Alias) Normally when ever we create a variable in C++ program, a new memory location is created and some value is stored in that memory location. An example is given below int x=35; int y=x;

More information

St. Teresa School A Temple of Learning Shakti Khand II, Indirapuram, Ghaziabad Holiday Assignment ( ) Class: XI

St. Teresa School A Temple of Learning Shakti Khand II, Indirapuram, Ghaziabad Holiday Assignment ( ) Class: XI St. Teresa School A Temple of Learning Shakti Khand II, Indirapuram, Ghaziabad Holiday Assignment (2018-19) Class: XI English Paste one prototype of advertisements (one each) in a separate folder. 2.Make

More information

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS COMPUTER APPLICATIONS (Theory) (Two hours) Answers to this Paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent

More information

3. Functions. Modular programming is the dividing of the entire problem into small sub problems that can be solved by writing separate programs.

3. Functions. Modular programming is the dividing of the entire problem into small sub problems that can be solved by writing separate programs. 1 3. Functions 1. What are the merits and demerits of modular programming? Modular programming is the dividing of the entire problem into small sub problems that can be solved by writing separate programs.

More information

CS 247: Software Engineering Principles. ADT Design

CS 247: Software Engineering Principles. ADT Design CS 247: Software Engineering Principles ADT Design Readings: Eckel, Vol. 1 Ch. 7 Function Overloading & Default Arguments Ch. 12 Operator Overloading U Waterloo CS247 (Spring 2017) p.1/17 Abstract Data

More information