C++ LANGUAGE MULTIPLE CHOICE QUESTION

Slides:



Advertisements
Similar presentations
Lecture 2 Introduction to C Programming
Advertisements

Introduction to C Programming
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Introduction to C Programming
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
True or false A variable of type char can hold the value 301. ( F )
 2006 Pearson Education, Inc. All rights reserved Control Statements: Part 2.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Introduction to C Programming
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Lecture 4 C Program Control Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
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.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Introduction to C Programming Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010 Fall.
Week 1 Algorithmization and Programming Languages.
THE BASICS OF A C++ PROGRAM EDP 4 / MATH 23 TTH 5:45 – 7:15.
Sections © Copyright by Pearson Education, Inc. All Rights Reserved.
Loops cause a section of a program to be repeated a certain number of times. The repetition continues while a condition remains true. When a condition.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Programming Fundamentals. The setw Manipulator setw changes the field width of output. The setw manipulator causes the number (or string) that follows.
 2007 Pearson Education, Inc. All rights reserved. A Simple C Program 1 /* ************************************************* *** Program: hello_world.
 2006 Pearson Education, Inc. All rights reserved Control Statements: Part 2.
Programming Fundamentals. Summary of Previous Lectures Phases of C++ Environment Data Types cin and cout.
 2003 Prentice Hall, Inc. All rights reserved Basics of a Typical C++ Environment C++ systems –Program-development environment –Language –C++
C Program Control September 15, OBJECTIVES The essentials of counter-controlled repetition. To use the for and do...while repetition statements.
OPERATORS IN C CHAPTER 3. Expressions can be built up from literals, variables and operators. The operators define how the variables and literals in the.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Bill Tucker Austin Community College COSC 1315
Chapter 1.2 Introduction to C++ Programming
Chapter 2: Basic Elements of C++
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
REPETITION CONTROL STRUCTURE
Introduction to C++ Programming
Chapter 2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
CSC201: Computer Programming
Chapter 2: Introduction to C++
The setw Manipulator The setw manipulator causes the number (or string) that follows it in the stream to be printed within a field n characters wide, where.
Chapter 4 C Program Control Part I
Completing the Problem-Solving Process
Chapter 2 - Introduction to C Programming
Programming Fundamental
Java Primer 1: Types, Classes and Operators
Multiple variables can be created in one declaration
Chapter 2 - Introduction to C Programming
CET 3640 – Lecture 2 Java Syntax Chapters 2, 4, 5
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
2.1 Parts of a C++ Program.
Introduction to C++ Programming
Chapter 8 JavaScript: Control Statements, Part 2
1.13 The Key Software Trend: Object Technology
Chapter 7 Additional Control Structures
Chapter 2 - Introduction to C Programming
Chapter 3: Input/Output
Chapter 2 - Introduction to C Programming
Introduction to C++ Programming
elementary programming
C Programming Getting started Variables Basic C operators Conditionals
Chapter 2: Introduction to C++.
Programs written in C and C++ can run on many different computers
Engineering Problem Solving with C++ An Object Based Approach
Fundamental Programming
Chapter 2 - Introduction to C Programming
Primitive Types and Expressions
C++ Programming Basics
Using C++ Arithmetic Operators and Control Structures
Introduction to C Programming
Presentation transcript:

C++ LANGUAGE MULTIPLE CHOICE QUESTION

1. PASCAL, BASIC and C are: Procedural languages Object oriented languages Non-procedural languages None of these www.prolearninghub.com

Non-procedural language 2. C++ is a: Procedural language OO language Non-procedural language None of these www.prolearninghub.com

3. The two major components of an object are: Function and class Function and object Function and data None of these www.prolearninghub.com

4. In C++ a function contained within a class is called: A member function A class An operator An data item www.prolearninghub.com

5. Protecting data from access by unauthorized functions is called: Data hiding Data manipulation Data mining Data integration www.prolearninghub.com

6. Which of the following are good reasons to use an object oriented language? You can define your own data types Program statements are simpler than its procedural language An OO program can taught to correct its own errors It's much diffcult to conceptualize an OO object www.prolearninghub.com

7. ---------- model entities in the real world more closely then do functions? Class object Function System www.prolearninghub.com

8. A C++ program is ----- than a C program except for details of coding: similar different tough None of these www.prolearninghub.com

9. Bundling data and functions together is called: Method declaration Encapsulation Data hiding Program formatting www.prolearninghub.com

10. When a language has the capability to produce new data types: Reprehensible Encapsulated Overloaded Extensible www.prolearninghub.com

11. What does compiler do with white space Consider them Ignore them Print them Ignore the www.prolearninghub.com

12. The ability of a function or operator to act in a different ways in different data types is called: Polymorphism Inheritance Encapsulation None of these www.prolearninghub.com

13. A normal C++ operator that acts in special way in newly defined data types are called as Glorified Encapsulated Classified Overloaded www.prolearninghub.com

14. “Memorizing the new terms used in C++ is” Critically important Something you can return to later The key of wealth and success Completely irrelevant www.prolearninghub.com

15. Dividing a program into functions: Is the key to OO programming Make the program easier to conceptualize May reduce the size of program Make the program run faster www.prolearninghub.com

16. A function name must be followed by: Curley brackets Parentheses Round brackets Square brackets www.prolearninghub.com

17. A function body is delimited by: Braces [] Braces {} Braces () None of these www.prolearninghub.com

18. Why the main function is special: Because program execution starts from main function Because all code reside in main function Because main reserve the memory for program None of mentioned www.prolearninghub.com

19. A C++ instructions that tell a computer to do something is called: Function class Statement Declaration www.prolearninghub.com

20. An expression: Usually evaluates to a numerical value Indicates the emotional state of a program Always occur outside a function May be a part of a statement www.prolearninghub.com

21. Specify how many bytes occupied by int? 3 4 5 www.prolearninghub.com

22. Specify how many bytes occupied by long? 4 6 8 www.prolearninghub.com

23. Specify how many bytes occupied by long double? 4 6 8 10 www.prolearninghub.com

24. A variable of type ---- can hold the value 301. Int Char Long Double www.prolearninghub.com

25. In an assignment statement a value on the left is always equal to the value of the left? Yes No Depend on condition None of these www.prolearninghub.com

26. cout is used for: Print a statement Declare a variable Function declaration None of these www.prolearninghub.com

27. What header must you #include with your source file to use cout and cin? IOSTREAM.H IOSTREAM.M IOSTREAM.G IOSTREAM.P www.prolearninghub.com

28. Write a statement to get a numerical value from the keyboard in a variable temp. Cout << temp; Cout = temp; Cin >> temp; None of this www.prolearninghub.com

Not perfactly but partialy 29. Is it perfectly all right to use variable of different data types in a same arithmetic expression? Yes No Not perfactly but partialy Can't specify www.prolearninghub.com

30. The expression 10 % 3 evaluates to: 2 3 4 5 www.prolearninghub.com

31. An arithmetic assignment operator is combines the effect of two operators: Assignment (=) and arithmetic (like + or *) > and < Logical operator and assignment None of these www.prolearninghub.com

32. In C++ the term “casts” applies to Data conversion Data storing Data manipulating Data hiding www.prolearninghub.com

33. Assuming var1 is starts from 20, what will be following code fragment printout? Count << var1--; Count << ++var1; 2019 1920 2020 2021 www.prolearninghub.com

The arithimatic operator that only work with integer variable is called? Remainder operator Relational operator comparison operator None of these www.prolearninghub.com

32. The increment operator increases the value of a number by------? 1 2 3 4 www.prolearninghub.com

35. A relational operator: (Choose all that apply) Assign one operand to another Yields a Boolean result Compare two operands Logically combine two operands www.prolearninghub.com

37. Name the three expressions in the for loop Initialization, test, increment or decrement Initialization, test, termination Initialization, finalization, termination None of these www.prolearninghub.com

38. In a for loop with multi-statement semicolons should appear following: (Choose all that apply) The for statement itself The closing braces in a multi-statement loop body Each statement is a loop body The test expression www.prolearninghub.com

39. The increment expression in a for loop can decrement the loop variable True False www.prolearninghub.com

40. A block of code is delimited by: Body class functions Braces {} www.prolearninghub.com

41. A variable defined within a block is visible: From the point of definition onward in the program From the point of definition onward in the function From the point of definition onward in the block Throughout in the function www.prolearninghub.com

42. Relational operators have the ------- higher precedence then arithmetic operators. Lower Higher Depend on situation Equal precedence www.prolearninghub.com

43. How many time is the loop body executed in a do loop. One time Two times At least one time Three times www.prolearninghub.com

44. The library function exit () am exit from: In loops in which it occurs The block in which it occurs The function in which it occurs The program in which it occurs www.prolearninghub.com

45. The getche () function returns---- . A character when any key is pressed Returns a character when enter is pressed Display a character when pressed any key Does not display any character on the screen www.prolearninghub.com

46. What is the character obtained when we pressed enter from keyboard? ‘ / ’ www.prolearninghub.com

47. An else is always matches the ----- if, unless the if is surrounded by the braces {}. Preceding Deciding Seceding None of these www.prolearninghub.com

48. The else if construction is obtained from if…. else by -------? Formatting Reformatting Clearing None of these www.prolearninghub.com

49. The && and || operators: Compare two numeric values Combine two numeric values Compare two Boolean values Combine two Boolean values www.prolearninghub.com

50. The break statement causes an exit: Only from the innermost loop Only from the innermost switch From all loops and switches From innermost loop or switch www.prolearninghub.com