This document outlines an exam for an Object Oriented Programming course, assessing students' understanding of key C++ concepts. The exam contains 10 questions assessing abilities like basic C++ concepts, object-oriented features, template classes, exception handling, and design patterns. It will be 3 hours long and cover topics like classes, objects, inheritance, polymorphism, operator overloading, templates, exceptions, and friend functions. Students will be evaluated on their comprehension, application, analysis and creation of C++ programming solutions according to Bloom's taxonomy.
This document contains questions and answers related to Object Oriented Programming in C++ across 5 units. It covers fundamental OOP concepts like classes, objects, encapsulation, inheritance and polymorphism. It also discusses advanced topics such as function overloading, templates, exception handling and file I/O using streams. The questions range from short definitions to explanations requiring examples and code snippets.
The document discusses object-oriented programming concepts and their implementation in C++. It introduces five major principles of OOP: data abstraction, encapsulation, information hiding, polymorphism, and inheritance. It describes how these concepts are realized in C++ through classes, public and private members, operator overloading, and derived classes. The document also contrasts C and C++ features like strong typing and use of new/delete instead of malloc/free for memory management.
This document provides an introduction to C++, covering key topics such as data types, operators, control statements, functions, and structures. It begins with learning outcomes and then discusses C++ characteristics, object-oriented programming principles, and how a C++ program is translated and its general structure. Subsequent sections cover C++ tokens like identifiers, keywords, literals, and operators. Input/output operators and control statements like selection and iteration are also introduced. The document concludes with explanations of data types and type conversion.
Introduction to cpp language and all the required information relating to itPushkarNiroula1
C++ is an object-oriented programming language developed in the early 1980s as an extension of C with additional features like classes, inheritance, and function overloading. A simple C++ program prints a string to the screen using the cout output stream and iostream header. C++ programs typically contain functions, comments, and use operators like << for output and >> for input.
Introduction to c++ programming languageAhmad177077
C++ is a powerful, high-performance, general-purpose programming language that supports procedural, object-oriented, and generic programming paradigms. It is widely used for developing applications where efficiency and performance are critical, such as operating systems, game development, and real-time systems.
C++ is a cross-platform language that can be used to create high-performance applications.
C++ was developed as an extension of C, and both languages have almost the same syntax.
The main difference between C and C++ is that C++ support classes and objects, while C does not.
C++ was developed by Bjarne Stroustrup, as an extension to the C language.
C++ gives programmers a high level of control over system resources and memory.
The language was updated 4 major times in 2011, 2014, 2017, and 2020 to C++11, C++14, C++17, C++20.
C++ is one of the world's most popular programming languages.
C++ can be found in today's operating systems, Graphical User Interfaces, and embedded systems.
C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs.
C++ is portable and can be used to develop applications that can be adapted to multiple platforms.
C++ is fun and easy to learn!
As C++ is close to C, C# and Java, it makes it easy for programmers to switch to C++ or vice versa.
Google: C++ is used for lots of google magic like Big table, Google file system, Google Chromium browser, and MapReduce large cluster data processing are all written in C++.
Mozilla uses a subset of C++. C++ 14 is required to build Mozilla 59, Mozilla Firefox, and Thunderbird email chat client are both written using C++.
Microsoft: Lots of windows apps that you regularly use are written in C++, It features tools for developing and debugging C++ code, especially code written for the DirectX, Windows API, and .NET.
Rockstar Games: Almost all major game companies use C++ due to its right speed on bare metal. Many major game engines are fully written in C++ and leverage its speed and OOPs capabilities.
MongoDB: MongoDB is an open-source database, widely used as the back-end store for web applications, as well as in large enterprises like Viacom, biotechnology giants, and Disney.
Games and Animations: C++ is used for developing games. It simplifies the complexity of 3-Dimensional games and helps in optimizing the resources. Procedure Oriented programming
Object Oriented programming
Basic Concept of Object Oriented programming
A simple C++ Program
Structure of C++ Program
Application of C++
This document contains sample test papers for the subject Object Oriented Programming. It includes 3 sample test papers with questions related to OOP concepts like classes, objects, inheritance, polymorphism, operator overloading etc. The questions are in multiple choice and descriptive form evaluating student's understanding of key OOP concepts. The test papers follow a standard format providing instructions, marks allocation per question, and assume students have prerequisite knowledge of C++ and OOP.
This document provides an introduction to C++ and covers 10 topics: 1) Object-oriented programming principles, 2) Classes and objects, 3) Functions, 4) Constructors and destructors, 5) Operator overloading and type conversion, 6) Inheritance, 7) Pointers, virtual functions and polymorphism, 8) Working with files, 9) Templates, and 10) Exception handling. Each topic is briefly described in 1-2 paragraphs with examples provided for some concepts like encapsulation, inheritance, polymorphism, and exception handling. The document serves as a high-level overview of key C++ concepts and features.
The document discusses editing, compiling, and executing a simple C++ program. It begins with an overview of basic C++ programming elements and concepts like tokens, data types, arithmetic operators, and precedence. It then provides examples of simple C++ programs that perform arithmetic calculations and output results. The document emphasizes that understanding programming fundamentals like variables, data types, expressions, and control flow is necessary before writing even basic C++ programs.
C++ is an object-oriented programming language. It was developed by Bjarne Stroustrup
at AT and T Bell Laboratories USA, in the early 1980’s. Stroustrup, an admirer of
Simula67 and a strong supporter of C wanted to combine the best of both the languages
and create a more powerful language that could support object-oriented programming
features and still retain the power and elegance of C. The result was C++
1. Introduction to C++ and brief historyAhmad177077
C++ is a powerful, high-level programming language that was developed by Bjarne Stroustrup in 1983. It's an extension of the C programming language with added features such as object-oriented programming (OOP) and generic programming capabilities.
Here are some key concepts and features of C++:
Object-Oriented Programming (OOP): C++ supports OOP principles such as classes, objects, inheritance, polymorphism, and encapsulation. This allows for the creation of modular and reusable code.
Syntax: C++ syntax is similar to C, but with additional features. It uses semicolons to end statements and curly braces to define blocks of code. It also supports a wide range of operators for arithmetic, logical, and bitwise operations.
Standard Template Library (STL): C++ provides a rich set of libraries known as the Standard Template Library (STL), which includes containers (like vectors, lists, maps), algorithms (such as sorting and searching), and iterators.
Memory Management: Unlike some higher-level languages, C++ gives programmers control over memory management. It allows manual memory allocation and deallocation using new and delete operators. However, this also introduces the risk of memory leaks and segmentation faults if not used carefully.
Portability: C++ code can be compiled to run on various platforms, making it a portable language. However, platform-specific code may need adjustments for different environments.
Performance: C++ is known for its high performance and efficiency. It allows low-level manipulation of resources, making it suitable for system-level programming, game development, and other performance-critical applications.
Community and Resources: C++ has a vast community of developers and extensive documentation available online. There are many tutorials, forums, and books to help programmers learn and master the language.
When learning C++, it's essential to understand the fundamentals thoroughly, including data types, control structures (like loops and conditionals), functions, and pointers. As you become more proficient, you can explore advanced topics like templates, exception handling, multithreading, and more.
Overall, C++ is a versatile language with a wide range of applications, from system programming to game development to web applications. Mastering it can open up many opportunities for software development.Community and Resources: C++ has a vast community of developers and extensive documentation available online. There are many tutorials, forums, and books to help programmers learn and master the language.
When learning C++, it's essential to understand the fundamentals thoroughly, including data types, control structures (like loops and conditionals), functions, and pointers. As you become more proficient, you can explore advanced topics like templates, exception handling, multithreading, and more.
Overall, C++ is a versatile language with a wide range of applications, from system programming to game development to web
Here is the class Book with the requested attributes and member functions:
#include <iostream>
using namespace std;
class Book {
private:
string title;
string author;
string publisher;
float price;
public:
Book() {
title = "No title";
author = "No author";
publisher = "No publisher";
price = 0.0;
}
void display_data() {
cout << "Title: " << title << endl;
cout << "Author: " << author << endl;
cout << "Publisher: " << publisher << endl;
cout << "Price: " << price << endl;
}
This document contains sample questions and answers related to object oriented programming concepts. It is organized into 5 units covering topics such as basic OOP principles, classes and objects, inheritance, templates and exceptions, and file handling and the standard template library. Sample questions provide explanations, code snippets, and program examples illustrating key concepts in C++ such as classes, inheritance, polymorphism, templates, exceptions, file I/O, and the STL.
C++ is an enhanced version of C that adds support for object-oriented programming. Procedure-oriented programming focuses on functions and algorithms, dividing programs into functions that share global data. Object-oriented programming treats data as critical, tying it more closely to the functions that operate on it and protecting it from accidental modification. C++ uses cout and cin for input/output instead of printf and scanf, and supports comments with // for single-line and /* */ for multi-line comments. Classes allow for data hiding, inheritance, and operator overloading that structures cannot provide.
The document provides an introduction to C++ programming and the Visual Studio IDE. It discusses key C++ concepts like headers, namespaces, I/O operators, and sample programs. It also covers setting up and debugging projects in Visual Studio, including adding breakpoints and stepping through code. The lab session aims to familiarize students with C++ programming and Visual Studio to lay the foundation for object-oriented concepts covered in subsequent labs.
Unit 1 of c++ part 1 basic introductionAKR Education
This document provides an overview and introduction to C++ programming. It discusses that C++ is an object-oriented programming language created in 1983 as an extension of C. It allows programmers to write low-level and high-level code and supports features like abstraction, encapsulation, inheritance and polymorphism. The document also discusses compilers for C++ on different operating systems and the differences between C and C++ programming.
The document provides an overview of the C standard library. It includes a table listing common C standard library header files and briefly describing their purpose, such as <stdio.h> for input/output functions and <stdlib.h> for memory allocation and process control. The C standard library contains functions for tasks like string manipulation, mathematics, random numbers, memory management and more. It provides a standard library that is common across C implementations.
The document provides an overview of key concepts in C++, including:
1) C++ adds object-oriented programming capabilities to C while maintaining C's power and flexibility. It was created in 1979 to provide object-oriented programming features to C.
2) Object-oriented programming encourages breaking problems into constituent parts called objects that contain related instructions and data. The three main traits of OOP are encapsulation, polymorphism, and inheritance.
3) C++ supports both traditional and modern styles, with newer headers placed in the std namespace. Keywords like class, public, and virtual allow defining classes and controlling access to members. Functions can be overloaded if their signatures differ.
This document discusses the key concepts of object-oriented programming (OOP). It covers the basic features of OOP like emphasis on data over procedures, dividing programs into objects, and defining data structures to characterize objects. It also discusses important OOP concepts like classes, encapsulation, inheritance, polymorphism, and dynamic binding. The document provides examples to illustrate these concepts and highlights benefits of the OOP paradigm like code reusability and modularity.
This document provides a lab manual for the fourth semester computer science engineering course on Object Oriented Technology. It includes the syllabus, rationale for object oriented programming, hardware and software requirements, a list of practical experiments to be conducted, and sample code for some of the experiments. The experiments cover topics like function overloading, inheritance, polymorphism, constructors, destructors, copy constructors, friend functions, and use of local, static and global objects. Each experiment is followed by sample output and questions related to the concepts covered in the program. The document aims to provide guidance to students on the practical implementation of object oriented programming concepts using C++.
This document discusses the C programming language and data structures. It covers the basic structure of C programs, including functions, main functions, and sections like documentation, definitions, declarations, and subprograms. It also discusses basic C programs, data types, operators, control structures, arrays, pointers, structures, unions, and file I/O. The document is intended to introduce students to C language concepts and data structures.
Introduction to c++ programming languageAhmad177077
C++ is a powerful, high-performance, general-purpose programming language that supports procedural, object-oriented, and generic programming paradigms. It is widely used for developing applications where efficiency and performance are critical, such as operating systems, game development, and real-time systems.
C++ is a cross-platform language that can be used to create high-performance applications.
C++ was developed as an extension of C, and both languages have almost the same syntax.
The main difference between C and C++ is that C++ support classes and objects, while C does not.
C++ was developed by Bjarne Stroustrup, as an extension to the C language.
C++ gives programmers a high level of control over system resources and memory.
The language was updated 4 major times in 2011, 2014, 2017, and 2020 to C++11, C++14, C++17, C++20.
C++ is one of the world's most popular programming languages.
C++ can be found in today's operating systems, Graphical User Interfaces, and embedded systems.
C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs.
C++ is portable and can be used to develop applications that can be adapted to multiple platforms.
C++ is fun and easy to learn!
As C++ is close to C, C# and Java, it makes it easy for programmers to switch to C++ or vice versa.
Google: C++ is used for lots of google magic like Big table, Google file system, Google Chromium browser, and MapReduce large cluster data processing are all written in C++.
Mozilla uses a subset of C++. C++ 14 is required to build Mozilla 59, Mozilla Firefox, and Thunderbird email chat client are both written using C++.
Microsoft: Lots of windows apps that you regularly use are written in C++, It features tools for developing and debugging C++ code, especially code written for the DirectX, Windows API, and .NET.
Rockstar Games: Almost all major game companies use C++ due to its right speed on bare metal. Many major game engines are fully written in C++ and leverage its speed and OOPs capabilities.
MongoDB: MongoDB is an open-source database, widely used as the back-end store for web applications, as well as in large enterprises like Viacom, biotechnology giants, and Disney.
Games and Animations: C++ is used for developing games. It simplifies the complexity of 3-Dimensional games and helps in optimizing the resources. Procedure Oriented programming
Object Oriented programming
Basic Concept of Object Oriented programming
A simple C++ Program
Structure of C++ Program
Application of C++
This document contains sample test papers for the subject Object Oriented Programming. It includes 3 sample test papers with questions related to OOP concepts like classes, objects, inheritance, polymorphism, operator overloading etc. The questions are in multiple choice and descriptive form evaluating student's understanding of key OOP concepts. The test papers follow a standard format providing instructions, marks allocation per question, and assume students have prerequisite knowledge of C++ and OOP.
This document provides an introduction to C++ and covers 10 topics: 1) Object-oriented programming principles, 2) Classes and objects, 3) Functions, 4) Constructors and destructors, 5) Operator overloading and type conversion, 6) Inheritance, 7) Pointers, virtual functions and polymorphism, 8) Working with files, 9) Templates, and 10) Exception handling. Each topic is briefly described in 1-2 paragraphs with examples provided for some concepts like encapsulation, inheritance, polymorphism, and exception handling. The document serves as a high-level overview of key C++ concepts and features.
The document discusses editing, compiling, and executing a simple C++ program. It begins with an overview of basic C++ programming elements and concepts like tokens, data types, arithmetic operators, and precedence. It then provides examples of simple C++ programs that perform arithmetic calculations and output results. The document emphasizes that understanding programming fundamentals like variables, data types, expressions, and control flow is necessary before writing even basic C++ programs.
C++ is an object-oriented programming language. It was developed by Bjarne Stroustrup
at AT and T Bell Laboratories USA, in the early 1980’s. Stroustrup, an admirer of
Simula67 and a strong supporter of C wanted to combine the best of both the languages
and create a more powerful language that could support object-oriented programming
features and still retain the power and elegance of C. The result was C++
1. Introduction to C++ and brief historyAhmad177077
C++ is a powerful, high-level programming language that was developed by Bjarne Stroustrup in 1983. It's an extension of the C programming language with added features such as object-oriented programming (OOP) and generic programming capabilities.
Here are some key concepts and features of C++:
Object-Oriented Programming (OOP): C++ supports OOP principles such as classes, objects, inheritance, polymorphism, and encapsulation. This allows for the creation of modular and reusable code.
Syntax: C++ syntax is similar to C, but with additional features. It uses semicolons to end statements and curly braces to define blocks of code. It also supports a wide range of operators for arithmetic, logical, and bitwise operations.
Standard Template Library (STL): C++ provides a rich set of libraries known as the Standard Template Library (STL), which includes containers (like vectors, lists, maps), algorithms (such as sorting and searching), and iterators.
Memory Management: Unlike some higher-level languages, C++ gives programmers control over memory management. It allows manual memory allocation and deallocation using new and delete operators. However, this also introduces the risk of memory leaks and segmentation faults if not used carefully.
Portability: C++ code can be compiled to run on various platforms, making it a portable language. However, platform-specific code may need adjustments for different environments.
Performance: C++ is known for its high performance and efficiency. It allows low-level manipulation of resources, making it suitable for system-level programming, game development, and other performance-critical applications.
Community and Resources: C++ has a vast community of developers and extensive documentation available online. There are many tutorials, forums, and books to help programmers learn and master the language.
When learning C++, it's essential to understand the fundamentals thoroughly, including data types, control structures (like loops and conditionals), functions, and pointers. As you become more proficient, you can explore advanced topics like templates, exception handling, multithreading, and more.
Overall, C++ is a versatile language with a wide range of applications, from system programming to game development to web applications. Mastering it can open up many opportunities for software development.Community and Resources: C++ has a vast community of developers and extensive documentation available online. There are many tutorials, forums, and books to help programmers learn and master the language.
When learning C++, it's essential to understand the fundamentals thoroughly, including data types, control structures (like loops and conditionals), functions, and pointers. As you become more proficient, you can explore advanced topics like templates, exception handling, multithreading, and more.
Overall, C++ is a versatile language with a wide range of applications, from system programming to game development to web
Here is the class Book with the requested attributes and member functions:
#include <iostream>
using namespace std;
class Book {
private:
string title;
string author;
string publisher;
float price;
public:
Book() {
title = "No title";
author = "No author";
publisher = "No publisher";
price = 0.0;
}
void display_data() {
cout << "Title: " << title << endl;
cout << "Author: " << author << endl;
cout << "Publisher: " << publisher << endl;
cout << "Price: " << price << endl;
}
This document contains sample questions and answers related to object oriented programming concepts. It is organized into 5 units covering topics such as basic OOP principles, classes and objects, inheritance, templates and exceptions, and file handling and the standard template library. Sample questions provide explanations, code snippets, and program examples illustrating key concepts in C++ such as classes, inheritance, polymorphism, templates, exceptions, file I/O, and the STL.
C++ is an enhanced version of C that adds support for object-oriented programming. Procedure-oriented programming focuses on functions and algorithms, dividing programs into functions that share global data. Object-oriented programming treats data as critical, tying it more closely to the functions that operate on it and protecting it from accidental modification. C++ uses cout and cin for input/output instead of printf and scanf, and supports comments with // for single-line and /* */ for multi-line comments. Classes allow for data hiding, inheritance, and operator overloading that structures cannot provide.
The document provides an introduction to C++ programming and the Visual Studio IDE. It discusses key C++ concepts like headers, namespaces, I/O operators, and sample programs. It also covers setting up and debugging projects in Visual Studio, including adding breakpoints and stepping through code. The lab session aims to familiarize students with C++ programming and Visual Studio to lay the foundation for object-oriented concepts covered in subsequent labs.
Unit 1 of c++ part 1 basic introductionAKR Education
This document provides an overview and introduction to C++ programming. It discusses that C++ is an object-oriented programming language created in 1983 as an extension of C. It allows programmers to write low-level and high-level code and supports features like abstraction, encapsulation, inheritance and polymorphism. The document also discusses compilers for C++ on different operating systems and the differences between C and C++ programming.
The document provides an overview of the C standard library. It includes a table listing common C standard library header files and briefly describing their purpose, such as <stdio.h> for input/output functions and <stdlib.h> for memory allocation and process control. The C standard library contains functions for tasks like string manipulation, mathematics, random numbers, memory management and more. It provides a standard library that is common across C implementations.
The document provides an overview of key concepts in C++, including:
1) C++ adds object-oriented programming capabilities to C while maintaining C's power and flexibility. It was created in 1979 to provide object-oriented programming features to C.
2) Object-oriented programming encourages breaking problems into constituent parts called objects that contain related instructions and data. The three main traits of OOP are encapsulation, polymorphism, and inheritance.
3) C++ supports both traditional and modern styles, with newer headers placed in the std namespace. Keywords like class, public, and virtual allow defining classes and controlling access to members. Functions can be overloaded if their signatures differ.
This document discusses the key concepts of object-oriented programming (OOP). It covers the basic features of OOP like emphasis on data over procedures, dividing programs into objects, and defining data structures to characterize objects. It also discusses important OOP concepts like classes, encapsulation, inheritance, polymorphism, and dynamic binding. The document provides examples to illustrate these concepts and highlights benefits of the OOP paradigm like code reusability and modularity.
This document provides a lab manual for the fourth semester computer science engineering course on Object Oriented Technology. It includes the syllabus, rationale for object oriented programming, hardware and software requirements, a list of practical experiments to be conducted, and sample code for some of the experiments. The experiments cover topics like function overloading, inheritance, polymorphism, constructors, destructors, copy constructors, friend functions, and use of local, static and global objects. Each experiment is followed by sample output and questions related to the concepts covered in the program. The document aims to provide guidance to students on the practical implementation of object oriented programming concepts using C++.
This document discusses the C programming language and data structures. It covers the basic structure of C programs, including functions, main functions, and sections like documentation, definitions, declarations, and subprograms. It also discusses basic C programs, data types, operators, control structures, arrays, pointers, structures, unions, and file I/O. The document is intended to introduce students to C language concepts and data structures.
Asymptotic analysis allows the comparison of algorithms based on how their running time grows with input size rather than experimental testing. It involves analyzing an algorithm's pseudo-code to count primitive operations and expressing the running time using asymptotic notation like O(f(n)) which ignores constants. Common time complexities include constant O(1), logarithmic O(log n), linear O(n), quadratic O(n^2), and exponential O(2^n). Faster algorithms have lower asymptotic complexity.
The document discusses the entity-relationship (ER) model for conceptual database design. It describes the key components of the ER model, including entities, attributes, relationships, and relationship constraints. It also explains how to develop an ER diagram for a sample company database, showing employees, departments, projects, and employee dependents. The document provides guidance on refining the initial design to create an appropriate ER model that clearly represents the data requirements.
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabanifruinkamel7m
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
Transform tomorrow: Master benefits analysis with Gen AI today webinar
Wednesday 30 April 2025
Joint webinar from APM AI and Data Analytics Interest Network and APM Benefits and Value Interest Network
Presenter:
Rami Deen
Content description:
We stepped into the future of benefits modelling and benefits analysis with this webinar on Generative AI (Gen AI), presented on Wednesday 30 April. Designed for all roles responsible in value creation be they benefits managers, business analysts and transformation consultants. This session revealed how Gen AI can revolutionise the way you identify, quantify, model, and realised benefits from investments.
We started by discussing the key challenges in benefits analysis, such as inaccurate identification, ineffective quantification, poor modelling, and difficulties in realisation. Learnt how Gen AI can help mitigate these challenges, ensuring more robust and effective benefits analysis.
We explored current applications and future possibilities, providing attendees with practical insights and actionable recommendations from industry experts.
This webinar provided valuable insights and practical knowledge on leveraging Gen AI to enhance benefits analysis and modelling, staying ahead in the rapidly evolving field of business transformation.
*"Sensing the World: Insect Sensory Systems"*Arshad Shaikh
Insects' major sensory organs include compound eyes for vision, antennae for smell, taste, and touch, and ocelli for light detection, enabling navigation, food detection, and communication.
Ajanta Paintings: Study as a Source of HistoryVirag Sontakke
This Presentation is prepared for Graduate Students. A presentation that provides basic information about the topic. Students should seek further information from the recommended books and articles. This presentation is only for students and purely for academic purposes. I took/copied the pictures/maps included in the presentation are from the internet. The presenter is thankful to them and herewith courtesy is given to all. This presentation is only for academic purposes.
Classification of mental disorder in 5th semester bsc. nursing and also used ...parmarjuli1412
Classification of mental disorder in 5th semester Bsc. Nursing and also used in 2nd year GNM Nursing Included topic is ICD-11, DSM-5, INDIAN CLASSIFICATION, Geriatric-psychiatry, review of personality development, different types of theory, defense mechanism, etiology and bio-psycho-social factors, ethics and responsibility, responsibility of mental health nurse, practice standard for MHN, CONCEPTUAL MODEL and role of nurse, preventive psychiatric and rehabilitation, Psychiatric rehabilitation,
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...parmarjuli1412
Mental Health Assessment in 5th semester Bsc. nursing and also used in 2nd year GNM nursing. in included introduction, definition, purpose, methods of psychiatric assessment, history taking, mental status examination, psychological test and psychiatric investigation
How to Create Kanban View in Odoo 18 - Odoo SlidesCeline George
The Kanban view in Odoo is a visual interface that organizes records into cards across columns, representing different stages of a process. It is used to manage tasks, workflows, or any categorized data, allowing users to easily track progress by moving cards between stages.
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18Celine George
In this slide, we’ll discuss on how to clean your contacts using the Deduplication Menu in Odoo 18. Maintaining a clean and organized contact database is essential for effective business operations.
How to Configure Public Holidays & Mandatory Days in Odoo 18Celine George
In this slide, we’ll explore the steps to set up and manage Public Holidays and Mandatory Days in Odoo 18 effectively. Managing Public Holidays and Mandatory Days is essential for maintaining an organized and compliant work schedule in any organization.
How to Manage Amounts in Local Currency in Odoo 18 PurchaseCeline George
In this slide, we’ll discuss on how to manage amounts in local currency in Odoo 18 Purchase. Odoo 18 allows us to manage purchase orders and invoices in our local currency.
1. Question Bank
Programme:
B.Tech. (IT)
Subject Name: Object Oriented Programming using C++
L: 3 T: 0 P: 0
Semester: 3 Subject Code: PCIT-102
Batch 2018 and onwards Class D2IT A and B
Part-A
Fundamental Concepts of a Programming Language
2 Marks:
1. Draw a diagram to represent the basic structure of a programin C++.
2. What do you mean by a token?
3. Differentiate between keywod and identifier.
4. Compare and contrast the variables and constants in C++. What are the rules to be followed for
identifiers?
5 Marks
5. What is the need of data types in C++? Describe different data types alongwith their
reprsentations and size in C++.
6. Give classification of operators available in C++ with the help of neat and clean diagram.
7. Define ternary operator. Compare it with if and if-else statement.
8. What do you mean by oprator precedence?
9. What is the needof type conversion? Discuss different types of type conversion in C++.
10 Marks
10. Classify the different statements available in C++.
11. Differentiate between nested if-else and switch statement.
12. Compare and contrast for, whileand do-while looping statements.
13. Differentiate between break and continue statement.
14. Why the use of goto statement is not good for quality programming?
15. What is the need of array. Discuss different types of arrays.
16. Discuss different string handling functions available in C++.
Object Oriented Paradigm
2 Marks:
1. What is the need of Object Oriented Programming paradigm?
2. Define Encapsulation and Data hiding.
3. Define Data Abstraction.
4. Define Data members.
5. Define Member functions.
6. Define Inheritance.
7. Define Polymorphism.
5 Marks:
8. Compare and contrast the structured programming and object oriented programming.
9. What are the features of Object oriented programming.
10. List and define the two types of Polymorphism.
11. Define Dynamic Binding.
12. Define Message Passing.
13. List some benefits of OOPS.
14. List out the applications of OOP.
15. What is the return type of main ()?
2. 10 Marks:
16. Explain the concept of polymorphism by an example in C++.
17. Compare and Contrast late binding and early binding.
Classes and Objects
2 Marks:
1. Define class and objects.
2. Write down the syntax and example to create a class.
3. Define reference variable. Give its syntax.
4. Define instance variables.
5 Marks:
5. What are the different ways to define member functions of a class. What is the role of scope
resolution operator in the definition of member function?
6. What is the need of passing objects as arguments. Discuss different ways to pass objects as
arguments to a function.
7. Discuss the benefits of retrurning objects from functions.
10 Marks:
8. Write a program to add two complex numbers using object as arguments.
9. Write a program to add two distances.
Object Initialization and Cleanup
2 Marks:
1. Discuss the use of public, private and protected access specifiers and their visibility in the class.
2. What is constructor?
5 Marks
2. Disfferentate between pass by value and pass by reference. Also explain the pass by address in
C++.
3.What is the need of constructor? How it is different from the member function?
4. Discuss default constructor and parameterized constructor with the help of an example in C++.
5. Write down the example of dynamic constructor in C++.
6. What is copy constructor?
7. Explain the use of destructor in C++.
10 Marks:
8. What is the significance of static data and member functions in C++?
9. Write down the program to demonstrate static keyword in c++.
Overloading and Inheritance
2 Marks:
1. What is the need of overloading operators and functions?
2.Write down the example to overload unary and binary operators in C++.
5 Marks:
3. Write down a C++ program to implement function overloading.
3. 4.What is the need of inheritance?
5. Draw a diagram to represent the forms of inheritance.
10 Marks:
6. Discuss the role of acess specifiers in inheritance and show their visibility when they are
inherited as public, private and protected.
7. Discuss the concept of generalization and aggregation.
8. How overriding is different from the overloading.
9. What is the use of super keyword in C++?
Part-B
Pointers and Run Time Polymorphism
2 Marks:
1. What is the need of abstract class in C++?
5 Marks:
2. Write a C++ program demonstrating use of the pure virtual function with the use of
base and derived classes.
3. What is the use of this keyword in C++?
10 Marks:
4. Write a program to demonstrate friend function in C++.
Exception Handling
2 Marks:
1. Compare and contrast error and exception.
2. Draw a neat and clean diagram to show exception handling model in C++.
5 Marks:
3. Write down a detailed C++ program to demonstate the use of try, catch , throw and nested try.
10 Marks:
4. What is a user defined exception. Wirte down the scenario where we require user defined
exceptions.
5. When do we need multiple catch blocks for a single try block? Give an example.
String Handling
2 Marks:
1. How string is used in C++? How can we create string object?
5 Marks:
2. Write a programin C++ to extract character from a string.
3. Draw a neat and clean sketch to show the different streams available in C++.
4. 10 Marks:
4. What is role of manipulators in C++. Write down different manipulators in C++.
5. Differentiate between formatted and unformatted I/O. Discuss its different functions.
File Handling and Templates
2 Marks:
1. What are the file strams?
2. Explain the process of open,read,write and close files?
5 Marks:
3. Explain the role of seekg(),seekp(),tellg(),tellp(),function in the process of random access in a
file.
4. Explain the Standard Template Library and how it is working.
10 Marks:
5. Write a C++ program using function template to find the product of two integer or
floating point type of data.
Programming exercises (5 Marks Each)
1. Write a C++ program to demonstrate the overloading of a unary operator.
2. Write a C++ program to demonstrate the overloading of a binary operator.
3. Write a C++ program involving the type conversion from a basic data type to class type.
4. Write a C++ program involving the type conversion from a class type to basic data type.
5. Write a C++ program involving the type conversion from one class type to another class.
6. Write a C++ program involving overriding of member function.
7. Write a C++ program involving a virtual function.
8. Write a C++ program to demonstrate function overloading.
9. Write a C++ program involving multiple catch statements for a try block.
10. Write a C++ program involving the handling of exceptions in constructors and destructors.
11. Write a C++ program involving input/output using overloaded operators << and >> and
member functions of I/O stream classes.
12. Write a C++ program involving a function template.
13. Write a C++ program involving a class template.
14. Write a C++ program involving working with a single file. Use ifstream and ofstream
classes to write and read the information to and from a file using operators:- << and >>.
Show how a file can be opened and closed.
15. Write a C++ program involving input/output operations on characters in a file. (Hint: put()
and get() functions).
16. Write a C++ program involving reading and writing of class objects in a file.
17. Write a C++ program to update the contents of a file by accessing the contents randomly.
--------------------------------------------------------------------------------------------------------------
5. MCQ Questions (2 Marks Each)
1. What is the output of the following
code? #include<iostream.h>
#include<string.h>
void main()
{
cout<<strlen(“Hello, World.n”)<<”n”;
}
(a) 14 (b) 13 (c) 12 (d) None
2. What is the output of the following
code? #include<iostream.h>
void main()
{
/* this is /* an example */ of nested comment
*/ cout<<123<<endl;
}
(a) 123 (b) Compile time error (c) None (d) Run time Error
3. What is the output of the following
code? #include<iostream.h>
void main()
{
cout << ;
}
(a) 1 (b) Compile time error (c) NIL (d) None
6. 4. What is the output of the following
code? #include<iostream.h>
void main()
{
int a = 20; int
&n = a;
n=a++;
a=n++;
cout<<a <<”,”<<n<<endl;
}
(a) 20, 20 (b) 20, 21 (c) 21, 22 (d) None
7. 5. What is the output of the following
code? #include<iostream.h>
void main()
{
int a = 20,b=100;
int &n = a;
n=a++;
n = &b;
cout<<a <<”,”<<n<<endl;
}
(a) 21, 21 (b) 20, 21 (c) 21, 22 (d) Error
6. What is the output of the following
code? #include<iostream.h>
void main()
{
bool a=10;
cout<<a<<endl;
}
(a) 10 (b) false (c) 1 (d) Error
7. What is the output of the following
code? #include<iostream.h>
void main()
{
int main; main = 100;
cout<<main++<<endl;
}
(a) 101 (b) 100 (c) None (d) Error: one cannot use main as identifier
8. 8. What is the output of the following
code? #include<iostream.h>
void main()
{
int a=0,x;
x = ++a * --a;
cout<<++a<< “ “ << a++ << ” ” << x <<endl;
}
(c) 2, 2, 2 (d) 3, 2, 2
(a) 0, 0, 0 (b) 2, 0, 0
9. What is the output of the following
code? #include<iostream.h>
void main()
{
a=32;
cout<<a<<endl;
}
int a;
(d) Run time error
(a) 32 (b) 0 (c) Compile time error
10.Which of the following is not valid expression?
(d) None
(a) 33 / 9 / 3 (b) 23 % ( 5 % 2 ) (c) 34 ( 7 / 3 )
11. Evaluate the m%n++ expression, assuming m=24 and n=7
(a) 4 (b) 3 (c) 2 (d) None
12. Evaluate the m%++n expression, assuming m=24 and n=7
(a) 4 (b) 3 (c) 2 (d) None
13. Which of the following statement is true?
(a) ! (p || q ) is the same as !p || !q
(b) !!!p is the same as !p
(c) p && q || r is the same as p && (q || r )
(d) None
9. 14. Elements in an array are identified by a unique .
(a) symbol (b) order (d) data type
(c) subscript
15. An address is a __ , while a pointer is a _
(e) None
(a) variable, location (b) variable, position (c) constant, variable
16. 6.5 is a ______ constant.
(d) character literal
(b) float literal (c) double literal
(a) string literal
17. To execute a C++ program, one first need to translate the source code into object code. This process if
called .
(d) coding
(a) translating (b) sourcing (c) compiling
18. What is wrong with the following
program? #include<iostream.h>
void main()
{
do
{
int b=0;
cout<<b;
b++;
}while(b!=10);
}
(a) There is nothing wrong in the program.
(b) Variable ‘b’ must not be initialized in the loop
(c) Variable ‘b’ must not be declared in the loop
(d) The condition for while loop is not valid
10. 19. Sending a copy of data to a program module is called .
(a) recursion (b) passing a reference (c) passing a value (d) None
20. Each generic type in a template function definition is preceded by the keyword
(a) class (b) type (c) function (d) template
21. Which of the followings is not a C++ opoerator?
(a) ^= (b) .* (c) &= (d) ->>
22. What is the output of the following
code? #include<iostream.h>
void main()
{
char p[]="This is a test";
cout<<sizeof(p)<<","<<strlen(p);
}
(a) 14, 14 (b) 15, 14 (c) 14, 15 (d) 15,15
23. What is wrong with the following
program? #include<iostream.h>
void main()
{
int a[5] = {0};
for(int i=0;i<2;i++)
a[i]=i;
for(int i=0;i<5;i++)
cout<<a[i]<<endl;
}
(a) Array ‘a’ is not initialized properly (b) There is no problem
(c) Redeclaration of variable ‘i’ (d) There is a run time error
11. 24. What is the output of the following
code? #include<iostream.h>
void main()
{
int a[5] =
{100,2,3,22,400}; int b[5];
b=a;
for(int i=0;i<5;i++)
cout<<b[i]<<endl;
}
(a) 100,2,3,22,400 (b) garbage values (c) error (d) None
25. What is the output of the following
code? #include<iostream.h>
void main()
{
int a[5] = {1,2,3};
for(int i=0;i<5;i++)
cout<<a[i]<<endl;
}
(a) No output (b) 1 2 3 garbage garbage
(c) 1 2 3 0 0 (d) There is a run time error
26. To delete a dynamically allocated array named ‘a’, the correct statement is
(a) delete a; (b) delete a[0]; (c) delete []a; (d) delete [0]a;
27. Which of the followings is not a valid assignment statement?
(a) total = 9; (b) name = “CDAC”;
(c) profit = 123.123; (d) A = ‘A’;
28. When do preprocessor directives execute?
(a) Before the compiler compiles the program.
(b) After the compiler compiles the program.
(c) At the same time as the compiler compiles the program.
12. (d) None
29. What is the output of the following
code? #include<iostream.h>
void main()
{
int i=5,j=0;
while(i-- || j++)
{
cout<<i<<" "<<j<<”,”;
}
}
(a) 5 1, 4 2, 3 3, 2 4, 1 5, (b) 4 0, 3 0, 2 0, 1 0, 0 0,
(c) 4 1, 3 2, 2 3, 1 4, 0 5, (d) None
30. What is the output of the following
code? #include<iostream.h>
void main()
{
int a;
bool b;
a = 12 > 100; b = 12 >=
100; cout<<a<<"
"<<b<<endl;
}
(a) Error (b) 0 false (c) 0 1 (d) 0 0
13. 31. What is the output of the following
code? #include<iostream.h>
int a = 1;
void main()
{
int a = 100;
{
int a = 200;
{
int a = 300;
cout<<a<<",";
}
cout<<a<<",";
}
cout<<a<<",";
cout<<::a<<",";
}
(a) Error (b) 100, 200, 300, 100,
(c) 300, 200, 100, garbage, (d) 300, 200, 100, 1,
32. What is the output of the following
code? #include<iostream.h>
void main()
{
int x=10;
(x<0)?(int a =100):(int a
=1000); cout<<a;
}
(a) Error (b) 1000 (c) 100 (d) None
33. What is the output of the following
code? #include<iostream.h>
void main()
14. {
int a = 0;
cout<<(a = 10/a);
}
(a) 0 (b) 1 (c) Compile Time error (d) Runtime Error
34. What is the output of the following
code? #include<iostream.h>
void main()
{
int x=0;
while(x++<5)
{
static x;
x+=2;
}
cout<<x<<" ";
}
(c) Compile Time error (d) Runtime Error
(a) 1 2 3 4 5 (b) 2 4 6 8 10
35. What is the output of the following
code? #include<iostream.h>
void main()
{
char str1[]=”India”,
str2[]=”India”; if(str1==str2)
cout<<”Both the string are same”;
else
cout<<”Both the string are not same”;
}
(a) Both the string are same (b) Both the string are not same
(c) Compile Time error (d) Runtime Error
15. 36. What is the output of the following code if user enters “This is a
test”? #include<iostream.h>
#include<string.h>
void main()
{
char str[8];
cin>>str;
cout<<str;
}
(a) This is a test (b) This is a (c) This (d) Error
37. What is the output of the following
code? #include<iostream.h>
void main()
{
int arr[] = {10,20,30,40,50};
int *ptr = arr;
cout<< *ptr++<<" "<<*ptr;
}
(a) 10 20 (b) 10 10 (c) 20 20 (d) 20 10
38. What is the output of the following
code? #include<iostream.h>
void main()
{
int arr[] = {10,20,30,40,50}; int
x,*ptr1 = arr, *ptr2=&arr[3];
x = ptr2 - ptr1;
}
cout<<x;
(c) Compile Time error (d) Runtime Error
(a) 6 (b) 3
16. 39. Which of the following statement is false about pointers?
(a) The ++ and -- operators may be used with pointer variables
(b) An integer may be added and subtracted from a pointer variable
(c) A pointer may be added to another pointer.
(d) A pointer may be subtracted from another pointer.
40. A null pointer is a pointer that contains
(a) the address 0 (b) the address that points to 0
(c) the address that points to ‘0’ (d) the address that points to -1
41. What is the output of the following
code? #include<iostream.h>
void main()
{
int arr[][3]={0,11,22,33,44,55};
int *a = &arr[0][0];
cout<<arr[1][2]<<" "<<*(a+3);
}
(a) 55 33 (b) 33 55 (c) Compile Time error (d) Runtime Error
42. What is the output of the following
code? #include<iostream.h>
void main()
{
int arr[2][3][2]={{{2,4},{7,8},{3,4},}, {{2,2},{2,3},{3,4},
}}; cout<<(*(*(*arr+1)+2)+0)+7;
}
(a) 10 (b) 3 (c) garbage value (d) Error
43. What is the output of the following
code? #include<iostream.h>
void main()
{
17. int arr[2][3][2]={{{2,4},{7,8},{3,4},}, {{2,2},{2,3},{3,4},
}}; cout<<**(*arr+1)+2+7;
}
(a) 16 (b) 7
(c) 11 (d) Error
44. The design of classes in a way that hides the details of implementation from the user is known as:
(a) Encapsulation (b) Information Hiding
(c) Data abstraction (d) All of the above
18. 45. Which of the following keywords do you think can be used when declaring static members in a class?
(i) Public (ii)
Private (iii)
Protected
(a) i, ii and iii. (b) i and ii.
(c) Only i. (d) i and iii.
46. I want a nonmember function to have access to the private members of a class. The class must declare
that function:
(a) friend (b) inline
(c) static (d) virtual
47. The ability to reuse objects already defined, perhaps for a different purpose, with
modification appropriate to the new purpose, is referred to as
(a) Information hiding. (b) Inheritance.
(c) Redefinition. (d) Overloading.
48. What do you think is the outcome of calling a redefined non-virtual function using a base-class
pointer?
(a) The appropriate redefined version of the function will be used.
(b) The base-class version of the function will always be used.
(c) The outcome is unpredictable.
(d) A run-time error will occur.
49. A class member that is to be shared among all objects of a class is called
(a) A const member (b) A reference parameter
(c) A static member (d) A function member
50. What is a base class?
(a) An abstract class that is at the top of the inheritance hierarchy.
(b) A class with a pure virtual function in it.
(c) A class that inherits from another class
(d) A class that is inherited by another class, and thus is included in that class.
19. 51. A variable that is declared protected:
(a) Is visible only in the subclasses (and not in the class it is declared in).
(b) Is visible only in the class it is declared in.
(c) Is visible to all classes, but modifiable only in the class where it is declared.
(d) Is visible in the class it is declared in, and all of its subclasses.
52. What is a destructor?
(a) A function called when an instance of a class is initialized.
(b)A function that is called when an instance of a class is deleted.
(c) A special function to change the value of dynamically allocated memory.
(d) A function that is called in order to change the value of a variable.
53. In protected inheritance:
(a) The public members of the base class become public.
(b) The public members of the base class become protected.
(c) The protected members of the base class become private.
(d) The public members of the base class become inaccessible.
54. If a class declares a variable static, this means:
(a) Each instance of a class will have its own copy of the variable.
(b) Changing the variable in one instance will have no effect on other instances of the class.
(c) There will be only one instance of the variable initialized for all classes.
(d) Every instance of the class must consider the value of the static variable before initializing.
55. In case of a copy constructor, which of the following is true?
(a) Used to instantiate an object from another existing object
(b) To copy one object to another existing object.
(c) Can be a substitute for a ‘=’ operator.
(d) All of the above.
56. A class declaring another class as a friend will:
(a) Have wine and cheese with that other friend.
(b) Allow that class to declare an instance of it in its list of private variables.
(c) Allow the other class (the one declared as friend) to access to the declaring class’s private variables
(d) Allow the class declaring the other as a friend to access the declared class’s private variables.
20. 57. Which of the following can be virtual?
(a) constructors
(b) destructors
(c) static functions
(d) None of the above
58. Where is an exception generated?
(a) In the catch block
(b) In the throw clause
(c) In the constructor of a class
(d) Only when memory allocation fails.
59. Static member functions
(a) can be used without an instantiation of an object.
(b) can only access static data.
(c) Both 1 and 2 are correct.
(d) Neither 1 nor 2 are correct.
60. What makes a class abstract?
(a) The class must not have method
(b) The class must have a constructor that takes no arguments
(c) The class must have a function definition equal to zero
(d) The class may only exist during the planning phase
21. 61.
#include<iostream.h>
class Base
{
int static i;
public:
Base(){}
};
class Sub1: public virtual Base{};
class Sub2: public Base{};
class Multi: public Sub1, public Sub2 {};
void main()
{
Multi m;
}
In the above program, how many times Base’s constructor will be called?
(a) 1 (b) 2
(c) 3 (d) none
62.
#include<iostream.h>
namespace N1
{
int f(int n) {return n*2;}
}
namespace N2
{
int f(double n) {return n*3;}
}
void main()
{
using N1::f;
22. int i1=f(1.0);
using N2::f;
int i2=f(1.0);
}
In the above code what would be the values of i1 and i2
(a) i1=2 i2=2 (b) i1=2 i2=3
(c) i1=3 i2=2 (d) Error
63.
#include<iostream.h>
class Base
{
public : int a;
protected: int b;
private: int c;
};
class Derived: Base
{
int d;
friend Friend;
};
class Friend
{
Derived derived;
};
In the above code, which of the following variables can be accessed in "Friend"?
(a) only a and b (b) a,b and c
(c) only a (d) Error
64. What is the output of the following code?
#include<iostream.h>
23. int count=0; class
obj
{
public :
obj(){count++;}
~obj(){count--;}
};
int main()
{
obj A,B,C,D,E; obj F;
{
obj G;
}
cout<<count; return
0;
}
(a) 0 (b) 5
(c) 1 (d) 6
65. What is the output of the following code?
#include<iostream.h>
int main()
{
for(int ii=0;ii<3;++ii)
{
switch(ii)
{
case 0:cout<<"zero ";
case 1:cout<<"one ";continue;
case 2:cout<<"two ";break;
}
}
return 0;
}
24. (a) zero one one two (b) zero one two
(c) zero two (d) none
66.What is the output of the following code?
#include<iostream.h>
class obj
{
public :
obj(){cout<<"in ";}
~obj(){cout<<"out ";}
};
int main()
{
obj A,B;
{
obj D;
}
obj E; return 0;
}
(a) in in in out in out out out (b) in in in in out out out out
(c) in in in out in out out out (d) none
67.What is wrong in the following code?
#include<iostream.h>
class Base
{
public :
Base(){};
virtual ~Base(){};
};
class Derived : protected Base
{
public:
virtual ~Derived(){};
};
25. int main()
{
Base *pb = new Derived(); return
0;
}
(a) There is nothing wrong
(b) One cannot have a ‘Base’ pointer to ‘Derived’ since it is not derived publicly
(c) One need a derived class pointer to point to a derived class.
(d) One required to code a constructor for Derived.
68.What is the output of the following code?
#include<iostream.h>
class professor{public:professor(){cout<<"professor ";};}; class
researcher{public: researcher(){cout<<"researcher ";};};
class teacher: public professor{public: teacher(){cout<<"teacher ";};};
class myprofessor: public teacher, public virtual researcher
{public:myprofessor(){cout<<"myprofessor ";};};
int main()
{
myprofessor obj;
return 0;
}
(a) professor researcher teacher myprofessor
(b) researcher professor teacher myprofessor
(c) myprofessor teacher researcher professor
(d) myprofessor researcher professor teacher
69. What is the output of the following code?
#include<iostream.h>
class Parent
{
public:
Parent(){Status();}
virtual ~Parent() { Status();}
virtual void Status(){cout<<"Parent ";}
26. };
class Child: public Parent
{
public:
Child(){Status();}
virtual ~Child() { Status();}
virtual void Status(){cout<<"Child ";}
};
void main()
{
Child c;
}
(a) Parent Parent
(b) Parent Child Child Parent
(c) Child Parent Parent Child
(d) Error
70. What is wrong in the following code?
#include<iostream.h>
class Base
{
public:
virtual void Method()=0{n=1;}
private:
int n;
};
class D1:Base {};
class D2:public D1
{
int i;
void Method(){i=2;}
};
27. int main()
{
D2 test;
return 0;
}
(a) There is no error.
(b) There is a syntax error in the declaration of “Method”.
(c) Class D2 does not have access to “Method”.
(d) Class D1 must define “Method”.