Standard 11. Lesson 9. Introduction to C++( Up to Operators) 2. List any two benefits of learning C++?(Any two points)

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

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Java Notes. 10th ICSE. Saravanan Ganesh

Programming in C++ 4. The lexical basis of C++

JAVA Programming Fundamentals

Lecture 2 Tao Wang 1

PYTHON- AN INNOVATION

DECLARATIONS. Character Set, Keywords, Identifiers, Constants, Variables. Designed by Parul Khurana, LIECA.

Princeton University. Computer Science 217: Introduction to Programming Systems. Data Types in C

These are reserved words of the C language. For example int, float, if, else, for, while etc.

Basic data types. Building blocks of computation

ME240 Computation for Mechanical Engineering. Lecture 4. C++ Data Types

Typescript on LLVM Language Reference Manual

BSM540 Basics of C Language

VARIABLES AND CONSTANTS

Java Programming Fundamentals. Visit for more.

2 nd Week Lecture Notes

Number Systems, Scalar Types, and Input and Output

The type of all data used in a C++ program must be specified

FRAC: Language Reference Manual

CSc Introduction to Computing

Chapter 2 Getting Started with Python

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

Chapter 2. Lexical Elements & Operators

CHAPTER-6 GETTING STARTED WITH C++

The MaSH Programming Language At the Statements Level

Computer System and programming in C

Decaf Language Reference Manual

Data Types and Variables in C language

QUark Language Reference Manual

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

Exercises Software Development I. 03 Data Representation. Data types, range of values, internal format, literals. October 22nd, 2014

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Chapter 2 Elementary Programming

Visual C# Instructor s Manual Table of Contents

Gabriel Hugh Elkaim Spring CMPE 013/L: C Programming. CMPE 013/L: C Programming

Java Basic Datatypees

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

BASIC ELEMENTS OF A COMPUTER PROGRAM

1 Lexical Considerations

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI

MACHINE LEVEL REPRESENTATION OF DATA

Variables and Literals

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

Computers Programming Course 5. Iulian Năstac

.. Cal Poly CPE 101: Fundamentals of Computer Science I Alexander Dekhtyar..

The Java Language Rules And Tools 3

PYTHON. Values and Variables

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

INTRODUCTION 1 AND REVIEW

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual

Basic Elements of C. Staff Incharge: S.Sasirekha

TCL - STRINGS. Boolean value can be represented as 1, yes or true for true and 0, no, or false for false.

THE FUNDAMENTAL DATA TYPES

C++ Basics. Lecture 2 COP 3014 Spring January 8, 2018

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

Data and Expressions. Outline. Data and Expressions 12/18/2010. Let's explore some other fundamental programming concepts. Chapter 2 focuses on:

Full file at

UNIT 7A Data Representation: Numbers and Text. Digital Data

Programming in C and Data Structures [15PCD13/23] 1. PROGRAMMING IN C AND DATA STRUCTURES [As per Choice Based Credit System (CBCS) scheme]

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

Lexical Considerations

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

Differentiate Between Keywords and Identifiers

Language Reference Manual simplicity

Getting started with Java

CS102: Variables and Expressions

Basics of Java Programming

Tokens, Expressions and Control Structures

Overview of C. Basic Data Types Constants Variables Identifiers Keywords Basic I/O

6.096 Introduction to C++ January (IAP) 2009

1.1 Introduction to C Language. Department of CSE

Language Reference Manual

! A literal represents a constant value used in a. ! Numbers: 0, 34, , -1.8e12, etc. ! Characters: 'A', 'z', '!', '5', etc.

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

4 Programming Fundamentals. Introduction to Programming 1 1

ARG! Language Reference Manual

c++ keywords: ( all lowercase ) Note: cin and cout are NOT keywords.

Lexical Considerations

Advanced Computer Programming

LEXICAL 2 CONVENTIONS

4. Inputting data or messages to a function is called passing data to the function.

The type of all data used in a C (or C++) program must be specified

2/12/17. Goals of this Lecture. Historical context Princeton University Computer Science 217: Introduction to Programming Systems

Language Reference Manual

Unit 3, Lesson 2 Data Types, Arithmetic,Variables, Input, Constants, & Library Functions. Mr. Dave Clausen La Cañada High School

The Warhol Language Reference Manual

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

BITG 1233: Introduction to C++

IC Language Specification

Princeton University Computer Science 217: Introduction to Programming Systems The C Programming Language Part 1

ML 4 A Lexer for OCaml s Type System

Full file at

3. Except for strings, double quotes, identifiers, and keywords, C++ ignores all white space.

JME Language Reference Manual

Overview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program

ME 172. Lecture 2. Data Types and Modifier 3/7/2011. variables scanf() printf() Basic data types are. Modifiers. char int float double

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

The SPL Programming Language Reference Manual

Transcription:

Standard 11 Lesson 9 Introduction to C++( Up to Operators) 2MARKS 1. Why C++ is called hybrid language? C++ supports both procedural and Object Oriented Programming paradigms. Thus, C++ is called as a hybrid language. 2. List any two benefits of learning C++?(Any two points) C++ is a highly portable language and is often the language of choice for multi-device, multi-platform app development. C++ is an object-oriented programming language and includes classes, inheritance, polymorphism, data abstraction and encapsulation. C++ has a rich function library. C++ allows exception handling, inheritance and function overloading which are not possible in C. C++ is a powerful, efficient and fast language. It finds a wide range of applications from GUI applications to 3D graphics for games to realtime mathematical simulations. 3. Define character set. Give example. Character set is a set of characters which are allowed to write a C++ program. A character represents any alphabet, number or any other symbol (special characters) mostly available in the keyboard. 4. Write a note on reserved words? Give some example. Keywords are the reserved words which convey specific meaning to the C++ compiler. They are the essential elements to construct

C++ programs. C++ is a case sensitive programming language so, all the keywords must be in lowercase. Eg., int.,float,short 5. Define tokens and name the tokens available in C++? C++ program statements are constructed by many different small elements such as commands, variables, constants and many more symbols called as operators and punctuators. These individual elements are collectively called as Lexical units or Lexical elements or Tokens. 6. What do you mean by identifier? Identifiers are the user-defined names given to different parts of the C++ program viz. variables, functions, arrays, classes etc., These are the fundamental building blocks of a program. Every language has specific rules for naming the identifiers. 7. Name some rules for naming an identifier. The first character of an identifier must be an alphabet or an underscore (_). Only alphabets, digits and underscore are permitted. Other special characters are not allowed as part of an identifier. C++ is case sensitive as it treats upper and lower-case characters differently. Reserved words or keywords cannot be used as an identifier name.

8. What do you mean by constants? Literals are data items whose values do not change during the execution of a program. Therefore Literals are called as Constants. 9. List the types of constants available in C++? Integer Literals Floating-point Literals Boolean Literals. Character Literals. String Literals. 10. Define numeric constants? The numeric constants are numeric values, which are used as constants. 10. What are the types of Numeric constants? Integer Constants (or) Fixed point constants. Real constants (or) Floating point constants. 12. What do you mean by implicit conversion? If a Decimal constant declared with fractions, then the compiler will take only the integer part of the value and it will ignore its fractional part. This is called as Implicit Conversion. 13. What do you mean by integers? Integers are whole numbers without any fractions. 14. What are the types of integer constants? An integer constant must have at least one digit without a decimal point. It may be signed or unsigned. Signed integers are considered as negative

15. What do you mean by Hexadecimal constant? Any sequence of one or more Hexadecimal values (0. 9, A. F) that starts with 0x or 0Xis considered as an Hexadecimal constant. 16. What do you mean by real constants? A real or floating point constant is a numeric constant having a fractional component. These constants may be written in fractional form or in exponent form. 17. Write a note on Exponent form of real constants? Exponent form of real constants consists of two parts: (1) Mantissa and (2) Exponent. The mantissa must be either an integer or a real constant. The mantissa followed by a letter E or e and the exponent. The exponent should also be an integer. 18. What do you mean by Boolean literals? Boolean literals are used to represent one of the Boolean values(true or false). Internally true has value 1 and false has value 0. 19. What do you mean by Character Constants? A character constant is any valid single character enclosed within single quotes. A character constant in C++ must contain one character and must be enclosed within a single quote. 20. What do you mean by String Literals? Sequence of characters enclosed within double quotes are called as String literals. By default, string literals are automatically added with a special character \0 (Null) at the end.

21. What do you mean by Non-printable characters? Non-printable characters are those characters that cannot be typed directly from a keyboard during the execution of a program in C++, for example: backspace, tabs etc. These non-printable characters can be represented by using escape sequences. 22. Expand the following terms a) ANSI b) ASCII a)ansi- American National Standard Institute b) ASCII-American Standard Code for Information Interchange. 23. what do you mean by escape sequence? An escape sequence is represented by a backslash followed by one or two characters. Eg., \n- Newline

3 MARKS 1. Write a short note on history of C++? 2. List the benefits of C++? 3. Give short notes on Character set in C++? 4. Give short notes on Tokens in C++? 5. Give short notes on Keywords in C++? 6. Explain the rules for naming an identifier? 7. Explain about integer constant? 8. Write the following real constants into exponent form: i) 32.179 ii) 8.124 iii) 0.00007 9. What is the significance of null (\0) character in a string? 10. Write the following real constants into fractional form: i) 0.23E4 ii) 0.517E-3 iii) 0.5E-5 BASEERA NASHRIN, nashrinbaseera@gmail.com