ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]

Similar documents
Sample Paper - II Subject Computer Science

Sample Paper Class XI Subject Computer Sience UNIT TEST II

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

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; }

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

Time: 3Hours Maximum Marks: 70 Note. (i) All questions are compulsory.

COMPUTER SCIENCE (083)

CHAPTER-6 GETTING STARTED WITH C++

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

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

Object Oriented Programming Using C++ Mathematics & Computing IET, Katunayake

COMPUTER SCIENCE (083)

AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI ASSIGNMENT CLASS XI Session Chapter 1: Computer Overview

UNIT- 3 Introduction to C++

Set I Sample Paper Class XI Subject Computer Science Time: 3Hours Maximum Marks: 70 Note. (i) All questions are compulsory.

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

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

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

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

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

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

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

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

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

CHAPTER 4 FUNCTIONS. 4.1 Introduction

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

CSCE Practice Midterm. Data Types

CSCE Practice Midterm. Data Types

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

case control statement (switch case)

KENDRIYA VIDYALAYA PANGODE MONTHLY TEST I JUNE 2015 CLASS XII COMPUTER SCIENCE Time allowed: 1 1/2 Hours Max. Marks: 50

Introduction to Computer Science Midterm 3 Fall, Points

Chapter 1. Computer Overview

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

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

Lab Instructor : Jean Lai

Multiple Choice Questions ( 1 mark)

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

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

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

SRI SARASWATHI MATRIC HR SEC SCHOOL PANAPAKKAM +2 IMPORTANT 2 MARK AND 5 MARK QUESTIONS COMPUTER SCIENCE VOLUME I 2 MARKS

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

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

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

Lecture 2:- Functions. Introduction

A Freshman C++ Programming Course

6.096 Introduction to C++ January (IAP) 2009

Computer Programming. Decision Making (2) Loops

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

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

PROGRAMMING IN C AND C++:

CLASS-XI COMPUTER SCIENCE

Padasalai.Net s Model Question Paper

(i) Describe in detail about the classification of computers with their features and limitations(10)

Laboratory 0 Week 0 Advanced Structured Programming An Introduction to Visual Studio and C++

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

Questions Bank. 14) State any four advantages of using flow-chart

KLiC C Programming. (KLiC Certificate in C Programming)

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

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

8. Functions (II) Control Structures: Arguments passed by value and by reference int x=5, y=3, z; z = addition ( x, y );

Object Oriented Pragramming (22316)

b) Give the output of the following program: 6,70,70 2,70 210,282,59290

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

Split up Syllabus (Session )

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

Downloaded from

C++ PROGRAMMING SKILLS Part 2 Programming Structures

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

Lecture 04 FUNCTIONS AND ARRAYS

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

1. a) What #include statement do you put at the top of a program that does uses cin, cout or endl?

Introduction. What is function? Multiple functions form a larger program Modular programming

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

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

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

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

Functions in C++ Problem-Solving Procedure With Modular Design C ++ Function Definition: a single

Creating a C++ Program

UEE1302(1066) F12: Introduction to Computers and Programming Function (II) - Parameter

Question Bank (SPA SEM II)

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

CHAPTER 9 FLOW OF CONTROL

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

Subject: Computer Science

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Computer Applications Answer Key Class IX December 2017

C++ Programming: From Problem Analysis to Program Design, Third Edition

COMP 111 PROGRAMMING I MODULARITY USING FUNCTIONS

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1

Basic Source Character Set for C++ Language:

A function is a named group of statements developed to solve a sub-problem and returns a value to other functions when it is called.

Functions. Arash Rafiey. September 26, 2017

C++ PROGRAMMING SKILLS Part 4: Arrays

Tribhuvan University Institute of Science and Technology 2065

Programming Fundamentals. With C++ Variable Declaration, Evaluation and Assignment 1

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions

FORM 2 (Please put your name and form # on the scantron!!!!)

Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING

Arrays. Week 4. Assylbek Jumagaliyev

Transcription:

ASSIGNMENT-1 2016-17 CLASS-11 COMPUTER SCIENCE [C++] 1 Consider the following C++ snippet: int x = 25000; int y = 2*x; cout<< y << "\t" << x; Why does the output does not come as 50000? What could be the reason? 2 Write a program to input a digit and display its ASCII code. 3 What are tokens in C++? How many types of tokens allowed in C++? Exemplify your answer. 4 How are keywords different from identifiers? 5 Identify the errors in the following code segments: (i) int main( ) cout «Enter two numbers ; cin» num» auto; float area=length*breadth; (ii) #include <isostream.h> void Main( ) int a,b; cin << > ; if (a>b) MAX=a 6 What are literals in C++? How many types of literals are allowed in C++? 7 How are integer constants represented in C++? Explain with examples. 8 What are character constants in C++? How are these implemented? 9 Convert(22.25)10 to binary. Convert(423)10 to hexadecimal. 10 What is the significance of a null statement? 11 What is significance of My Computer? 12 Explain different types of operating systems. 13 What is an Operating System? Explain its any two functions 14 How is a compiler different from interpreter? 15 Convert (i) ( 10.10)10= (? )2 (ii) (101011.1110)2 =(? )10 16 What do you mean by run time error? 17 what is the deference between if and if else statement 18 Mention and explain briefly any three characteristics of a good program 19 How can you give a single line and multiline comments in C++ explain with suitable examples 20 What do you mean by header files? What is the difference between #include <iostream.h> and #include iostream.h 21 a) Classify the following variable names of c++ into valid and invalid category 2 (i) 1no (ii) num 1 (iii) num (iv) num1num (v) num+1 (vi) num.1

22 Give output of following code. #include<iostream.h> int m=5; void check(); int m=20; int m=10*::m; cout<<"m="<<m<<"::m="<<::m<<endl; check(); cout<<"m="<<m<<"::m="<<::m<<endl; check(); cout<<"::m="<<::m<<"m="<<m<<endl; void check() ++m; 23 What will be result of following statements if a=5, b=5 initially (i) ++a<=5 (ii) b++<=5 24 Name the header file(s) that shall be needed for successful compilation of the following C++ code. char name[40]; strcpy(name, India ); puts(name); 25 Explain conditional operator (?) with example in c++. 26 What is difference between / and % operators in c++? explain with a example 27 What do you mean by function prototype in C++ 28 Explain Break and Continue statement in C++ with example 29 Find syntax error(s) if any in following program ( Assume all header files are present) main<> int c; switch( c ); case 1.5: cout<< India is great\n ; break; case 2: cout<< hello\n ; break; // end of main // 30 How will you declare and define i)array named mark with 10 integer values ii)array named avg with 8 float values 31 Convert following while loop to for loop 2 int x=0; while(x<=100) cout<< the value of x is \n <<x; cout<< done \n ; x+=2; 32 Define token? 33 What is the difference between call by value and call by reference explain with suitable example 34 Find the output of the following program; 3 121

#include<iostream.h> #include<ctype.h> char Text[ ] = Comp@uter! ; for(int I=0; Text[I]!= \0 ;I++) if(!isalpha(text[i])) Text[I]= * ; else if(isupper(text[i])) Text[I]=Text[I]+1; else Text[I] = Text[I+1]; cout<<text; 35 What are differences between for and do- while loop? explain with example 36 How can you define Global Variable and Local Variable? Also, give a suitable C++ code to illustrate both. 2 37. Write a program to find the factorial of a number recursive function. 38 Write a program to find the total number of characters, lines and words in a paragraph of text. 39 Write a program to sort an array on N numbers in ascending order. Avoid duplication of elements. 40 Write a program to find the roots of a quadratic equation. Name the header file(s) that shall be needed for successful compilation of the following C++ code. 2 char name[40]; strcpy(name, India ); puts(name); 41 Explain conditional operator (?) with example in c++. 42 How will you declare and define 1 i)array named mark with 10 integer values ii)array named avg with 8 float values 43 Convert following while loop to for loop int x=0; while(x<=100) cout<< the value of x is \n <<x; cout<< done \n ; x+=2; 44 What is the difference b/w while & do while loop? 45 b) What are data types? What are all predefined data types in c++? 46 Write the corresponding C++ expressions for the following mathematical expressions: i) (a2+b2) (ii) (a+b)/(p+q) 2 47 Evaluate the following, where p, q are integers and r, f are floating point numbers. The value of p=8, q=4 and r=2.5 (i) f = p * q + p/q (ii) r = p+q + p % q 2 48 a) What is the output of the following? i) # include<iostream.h> void main ( )

int i=0; cout<<i++<< <<i++<< <<i++<<endl; cout<<++i<< <<++i<< <<++i<<endl 49 # include<iostream.h> a=3; a=a+1; if (a>5) cout<<a; else cout<<(a+5); 50 What will be the output of the following program segment? If input is as: (a) g (b) b (c) e (d) p cin >>ch; switch (ch) case g : cout<< Good ; case b : cout<< Bad ; break; case e : cout<< excellent ; break; default: cout<< wrong choice ; 51 Determine the output: for(i=20;i<=100;i+=10) j=i/2; cout<<j<< ; 52 What output will be the following code fragment produce? int val, res, n=1000; cin>>val; res = n+val >1750? 400:200; cout<<res; (i) if val=2000 (ii) if val=1000 (iii) if val=500 53 ind the error from the following code segment and rewrite the corrected code underlining the correction made. 2 # include(iostream.h) void main ( ) int X,Y; cin>>>x; for(y=0,y<10, Y++) if X= =Y cout<<y+x; else cout>>y; 54 Convert the following code segment into switch case construct. int ch; cin>>ch; If(ch = = 1)

cout<< Laptop ; else If(ch = = 2) cout<< Desktop ; else if(ch= = 3) cout<< Notebook ; else cout<< Invalid Choice ; 55 Convert the following code segment into do-while loop. #include<iostream.h> void main() int i; for(i=1;i<=20;++i) cout<< \n <<i; 56 Given the following code fragment int ch=5; cout << ++ch<< \n <<ch<< \n ; What output does the above code fragment produce? ii) What is the effect of replacing ++ ch with ch+1? 57 Which header files are required for the following? (i) frexp()( (ii) sqrt( ) (iii) rand( ) (iv) isupper() 58 i) (12)10 = ( X)2 ii) (347)8= (X)10 iii) (896)16= (X)8 iv) (100)10= (X)2 59 Write a C++ program to print table a given number Convert the following code segment into do-while loop. #include<iostream.h> void main() int i; for(i=1;i<=20;++i) cout<< \n <<i; 60 What is the difference between Global Variable and Local Variable? 61 What are the different types of functions supported in C language? 62 What are library functions? 63 What are actual parameters? 64 What are formal parameters? 65 What is the use of the return statement? 66 What are local variables? 67 Which operator is used to access the structure elements? 68 Write the syntax for structure definition 69 Which is the reserved word which is used in structure definition? 70 What are nested structures? 71 What is meant by an array of structures? 72 Write the differences between structures and arrays. 73 Why is main( ) function special?give two reason? 74 Write a program that accepts a character between a to z and prints next 4 characters?

75 Construct the logical expressions to represent the following condition: (a) Weight is greater than or equal to 115 but less than 125. (b) X is even (c) Donation is in the range 4000-5000 or guest is 1. (d) Ch is an uppercase letter. 76 What is significance of null character. 77 Write the oops concept with example. 78 WAP to print Simple Interest. 79 Explain the concept of polymorphism. 80 WAP to swap two numbers using call by reference method. 81 WAP to print add two matrices. 82 WAP to print create a function named sum. 83 WAP to print multiply two matrices. 84 WAP to print subtract two matrices. 85 WAP to print transpose two matrices. 86 WAP to print electricity bill. 87 WAP to print maximum no of an array. 88 WAp to print even or odd no. 89 WAP to concatenate two strings 90 WAP to print length of input string. 91 WAP to print converted temperature:1.celcius to Farenheit 2. Farenheit to Celicius 92 WAP to print square root of given number. 93 WAP to print @ @ @ @ @ @ @ @ @ @ 94 WAP to print wheather no is prime or not. 95 WAP to print day of a week using switch case. 96 WAP to print weather a number is in uppercase or not. 97 WAP to check a input is digit or not. 98 WAP to swap two numbers using call by value method. 99 The value of e is known to be 2.71828.Using this value,write a program to determine the value of the expression : 2-ye 2y +4 y 100 WAP to create a structure having student name,roll no,class and marks and display it. ----------xxxxxxxxxxxxxxxx------------