This document contains instructions and questions for a computer science exam. It covers topics like call by value vs call by reference in C++, header files, class definitions, functions, arrays, pointers, structures, inheritance, and file input/output. There are multiple choice, short answer, and code writing questions testing a variety of programming concepts.
The document provides a 3-hour computer science exam containing multiple questions related to C++ programming. It includes questions about automatic type conversion vs type casting, header files, syntax errors, output of code snippets, polymorphism, class definitions, function definitions, arrays, memory allocation, stacks, and postfix notation evaluation.
The document contains a sample question paper for CBSE Grade 12 Computer Science exam. It includes multiple choice, short answer and long answer questions on topics like C++ programming, object oriented concepts, data structures, databases and computer networks. Some questions ask to write C++ code for tasks like defining classes, sorting arrays, implementing stacks. Others involve evaluating C++ code snippets, answering conceptual questions, writing SQL queries and solving problems on Boolean algebra and logic circuits.
The document provides a sample question paper for Computer Science (Theory) - Class XII. It contains 7 questions with multiple parts assessing concepts like C++ programming, data structures, databases, computer networks and Boolean algebra. The questions include writing code segments, evaluating outputs, explaining concepts and solving problems related to arrays, classes, SQL queries and logic circuits.
The document contains a computer science question paper with 7 questions covering topics like C++, data structures, SQL, computer networks and Boolean algebra. Some of the questions ask to write C++ code for classes, functions and algorithms. Others involve writing SQL queries on sample tables and analyzing network topologies to suggest appropriate designs. The overall document tests knowledge of key concepts in these domains through descriptive and coding questions.
The document provides examples to illustrate the differences between various C++ concepts:
1) It compares call by value and call by reference, showing that call by reference updates the original variable unlike call by value.
2) It contrasts automatic type conversion and type casting, demonstrating that automatic conversion happens implicitly while type casting is explicit.
3) It distinguishes between local and global variables by defining local variables' scope as within a function, while global variables can be accessed anywhere.
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
This document provides instructions for a 3-hour computer science exam with 70 maximum marks. It includes 6 questions with subparts testing various C++ programming concepts. Question 1 covers local vs global variables, header files, error correction, and finding output. Question 2 differentiates class members, illustrates function overloading, and defines a class. Question 3 includes array functions for transferring content between arrays, finding an array element location, and queue operations. Question 4 involves file input/output functions for modifying a data file.
This document provides an overview of C++ programming concepts including:
- Procedure-oriented programming focuses on tasks like reading, calculating and printing using functions, while object-oriented programming emphasizes data through objects and classes.
- Some problems with C include lack of consideration for data elements and lack of security for networks.
- C++ classes contain variables and functions to characterize objects. Data and functions are tied together and data is hidden.
- Key concepts explained include objects, member functions, constructors, destructors, inheritance and polymorphism.
- Examples demonstrate basic C++ programs, classes, objects, arrays of objects, function overloading and the this pointer.
The document contains code snippets demonstrating different C++ programming concepts including structures, arrays, functions, parameters, and pointers. Some key examples are:
1) A structure defined to store student name and roll number, with an array of structures to hold multiple student records.
2) Functions demonstrated with and without return values, including passing parameters to functions.
3) Arrays used to store integer values and an array of structures to hold multiple student records.
4) Pointers passed as parameters to functions to modify passed in values.
The document provides a variety of short code examples illustrating common programming concepts in C++.
The document provides a 3-hour computer science exam containing multiple questions related to C++ programming. It includes questions about automatic type conversion vs type casting, header files, syntax errors, output of code snippets, polymorphism, class definitions, function definitions, arrays, memory allocation, stacks, and postfix notation evaluation.
The document contains a sample question paper for CBSE Grade 12 Computer Science exam. It includes multiple choice, short answer and long answer questions on topics like C++ programming, object oriented concepts, data structures, databases and computer networks. Some questions ask to write C++ code for tasks like defining classes, sorting arrays, implementing stacks. Others involve evaluating C++ code snippets, answering conceptual questions, writing SQL queries and solving problems on Boolean algebra and logic circuits.
The document provides a sample question paper for Computer Science (Theory) - Class XII. It contains 7 questions with multiple parts assessing concepts like C++ programming, data structures, databases, computer networks and Boolean algebra. The questions include writing code segments, evaluating outputs, explaining concepts and solving problems related to arrays, classes, SQL queries and logic circuits.
The document contains a computer science question paper with 7 questions covering topics like C++, data structures, SQL, computer networks and Boolean algebra. Some of the questions ask to write C++ code for classes, functions and algorithms. Others involve writing SQL queries on sample tables and analyzing network topologies to suggest appropriate designs. The overall document tests knowledge of key concepts in these domains through descriptive and coding questions.
The document provides examples to illustrate the differences between various C++ concepts:
1) It compares call by value and call by reference, showing that call by reference updates the original variable unlike call by value.
2) It contrasts automatic type conversion and type casting, demonstrating that automatic conversion happens implicitly while type casting is explicit.
3) It distinguishes between local and global variables by defining local variables' scope as within a function, while global variables can be accessed anywhere.
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
This document provides instructions for a 3-hour computer science exam with 70 maximum marks. It includes 6 questions with subparts testing various C++ programming concepts. Question 1 covers local vs global variables, header files, error correction, and finding output. Question 2 differentiates class members, illustrates function overloading, and defines a class. Question 3 includes array functions for transferring content between arrays, finding an array element location, and queue operations. Question 4 involves file input/output functions for modifying a data file.
This document provides an overview of C++ programming concepts including:
- Procedure-oriented programming focuses on tasks like reading, calculating and printing using functions, while object-oriented programming emphasizes data through objects and classes.
- Some problems with C include lack of consideration for data elements and lack of security for networks.
- C++ classes contain variables and functions to characterize objects. Data and functions are tied together and data is hidden.
- Key concepts explained include objects, member functions, constructors, destructors, inheritance and polymorphism.
- Examples demonstrate basic C++ programs, classes, objects, arrays of objects, function overloading and the this pointer.
The document contains code snippets demonstrating different C++ programming concepts including structures, arrays, functions, parameters, and pointers. Some key examples are:
1) A structure defined to store student name and roll number, with an array of structures to hold multiple student records.
2) Functions demonstrated with and without return values, including passing parameters to functions.
3) Arrays used to store integer values and an array of structures to hold multiple student records.
4) Pointers passed as parameters to functions to modify passed in values.
The document provides a variety of short code examples illustrating common programming concepts in C++.
This document discusses arrays and functions. It covers various topics related to arrays including declaring and manipulating multidimensional arrays, array parameters in functions, and converting between array types. It also provides an overview of functions, describing them as subparts of a program for obtaining input, performing calculations, and displaying output. Examples are given throughout to demonstrate array and function concepts.
The document is a sample paper for a Computer Science class test. It contains 7 questions covering various topics in C++ programming. Some key points:
- Question 1 covers output of code snippets, syntax errors, and pretty printing.
- Question 2 asks about programming methodology, documentation, and characteristics of good programs.
- Question 3 tests knowledge of header files, errors in code, and evaluating expressions.
- Question 4 includes topics like type casting, loop conversions, and output of a code fragment.
- Question 5 defines terms like tokens and variables and asks short questions on comparisons, arrays, and data types.
- Question 6 gives programming problems on matrices, structures, and finding diagonal sums.
-
The document contains 6 programs written in C++ to perform various tasks involving arrays and conditional operators:
1) Three programs to swap two values using a third variable, without a third variable, and by adding and subtracting values.
2) Two programs to find the maximum and minimum of 10 values stored in an array.
3) A program to find the largest of two values using a conditional operator.
4) A program to find the smallest of three values using a conditional operator.
The document provides an outline and overview of key concepts in C++ basics, including variables and assignments, identifiers, keywords, input and output, data types and expressions, and arithmetic. It discusses how variables represent memory locations, how to declare and initialize variables of different data types like int, double, char, and bool, and how to perform input and output using cout and cin.
This document contains a list of 23 programming problems/exercises related to C++ concepts like arrays, functions, classes, files, and data structures. Some examples include:
1) Writing a function to swap elements between columns of a 2D array.
2) Defining classes for concepts like Queue, Stack, Hotel booking etc. with relevant member functions.
3) Writing SQL queries to retrieve/manipulate data from provided tables on items, students etc.
4) Considering classes like Player derived from Coach and solving related problems.
The document provides detailed descriptions and examples for each problem/exercise.
The document provides an overview of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented, and high-level programming language. It can be used to develop desktop and web applications. Popular applications built using Python include Instagram, Google, Dropbox, Yahoo Maps, Spotify, and Reddit. The document also covers Python variables, data types, operators, and basic control structures like if/else statements and while loops. It provides examples of how to write, run, and execute Python code in both interactive and script modes.
This document discusses functions, arrays, and structures in C++. It covers:
- Declaring and defining functions
- Passing arrays and structures as arguments to functions
- Returning arrays and structures from functions
- Using multidimensional arrays as function parameters
- Examples of functions that read/write arrays and structures
The document discusses classes and files in C++. It covers:
1) Classes in C++, including declaring classes, private, protected, and public members, and examples of classes.
2) Files in C++, including streams, reading from and writing to files, and the standard input/output streams.
3) Specific file classes in C++ - ifstream for input, ofstream for output, and fstream for both. It also covers opening files using the open() function.
The document contains the code for a menu driven C++ program that performs various operations on matrices such as calculating row and column sums, finding the transpose, and checking if two matrices are equal. It defines functions to perform these operations and contains a main function that inputs the matrices, displays a menu, and calls the appropriate functions based on the user's selection.
The document discusses user-defined data types in C++ including defined constants (#define), defining own types (typedef), constants (const), enumerations (enum), scope of variables, and structures (struct). The key objectives are to understand how to create user-defined data types.
The document discusses C++ strings and the string class. It covers string formats, the string class in the C++ standard library, string constructors, assigning and comparing strings, and input/output with strings using the insertion and extraction operators. It also covers using the getline function to read entire lines of input into string variables.
The document discusses function overloading in C++ and provides an example program to calculate the area of different shapes using function overloading. It then discusses constructors and destructors with examples and explains polymorphism with an example. Next, it discusses different types of inheritance in C++ and provides an example program to implement operator overloading for a distance class. It also discusses virtual functions with an example and access specifiers in classes. Finally, it provides examples to define a student class, implement quicksort using templates and overloading relational operators.
The document discusses procedural abstraction and predefined functions in computer programming. It provides examples of for loops and nested for loops to iterate through ranges of values. The for loop examples demonstrate how the initialization, boolean expression, and update components work together to execute the loop body. Tracing is used to step through multiple iterations of the for loops.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
The document contains a C++ code snippet that defines a class called TOYS. It has data members like ToyCode, ToyName, and AgeRange. It also has member functions like Enter() to input details, Display() to output details, and WhatAge() to return the AgeRange. The question asks to write a function to read TOYS objects from a binary file called TOYS.DAT and display details of toys meant for children aged "5 to 8".
The document contains 15 questions from previous year CBSE and other board exam papers related to C++ programming. Each question provides code snippets and asks to determine possible outputs, values of variables, minimum and maximum values etc. For each question, the correct answer is provided along with justification in 1-2 sentences where needed. The questions are testing concepts like random numbers, loops, arrays, functions etc. and ability to read code and analyze output.
This document appears to be a student project report submitted to a secondary school. It includes an acknowledgements section thanking guidance received. It also includes a certificate section signed by a computer science faculty member. The bulk of the document is an index listing 25 C++ programs with brief descriptions and signatures. The programs cover topics like arrays, sorting, functions, classes, pointers and file handling. In total, this report submitted a series of C++ programs to fulfill a school programming assignment.
C++11 introduced several new features for functions and lambdas including:
1. Lambda expressions that allow the definition of anonymous inline functions.
2. The std::function wrapper that allows functions and lambdas to be used interchangeably.
3. std::bind that binds arguments to function parameters for creating function objects.
These features improved support for functional programming patterns in C++.
Virtual functions allow functions in derived classes to override functions in base classes. When a base class pointer points to a derived class object, calling a virtual function through the pointer will call the derived class's version. This allows the same interface to behave differently based on the actual object. Virtual functions are useful for mathematical operations, where a base class defines an interface and derived classes perform specific calculations like addition, subtraction etc. depending on the object type pointed to by the base class pointer.
The document provides a model question paper for class 12 computer science. It contains 7 questions covering various topics like C++, OOPs, data structures, file handling, SQL, boolean algebra and networking. The paper has a total of 70 marks distributed across different sub-questions having 1, 2, 3 or 4 marks each. Detailed blueprints specifying the marks distribution across different units is also provided.
The summary provides the high level information from the document in 3 sentences:
The document contains a monthly test for Class XII CS with 20 multiple choice questions covering topics like C++ identifiers, header files, functions, classes, arrays, and searching algorithms. Students are asked to write code, find outputs, define functions, and describe concepts from object oriented programming and data structures. The questions progress from basic concepts to more advanced topics and require analytical thinking to understand programs, identify errors, define functions, and describe programming concepts.
This document contains questions from various years (2008-2012) related to object oriented programming concepts in C++. The questions cover topics such as classes and objects, inheritance, polymorphism, exception handling, functions, pointers, arrays, operators, input/output etc. Short questions ranging from 2-5 marks and long questions ranging from 5-10 marks are included related to concepts, syntax, programs and differences.
This document discusses arrays and functions. It covers various topics related to arrays including declaring and manipulating multidimensional arrays, array parameters in functions, and converting between array types. It also provides an overview of functions, describing them as subparts of a program for obtaining input, performing calculations, and displaying output. Examples are given throughout to demonstrate array and function concepts.
The document is a sample paper for a Computer Science class test. It contains 7 questions covering various topics in C++ programming. Some key points:
- Question 1 covers output of code snippets, syntax errors, and pretty printing.
- Question 2 asks about programming methodology, documentation, and characteristics of good programs.
- Question 3 tests knowledge of header files, errors in code, and evaluating expressions.
- Question 4 includes topics like type casting, loop conversions, and output of a code fragment.
- Question 5 defines terms like tokens and variables and asks short questions on comparisons, arrays, and data types.
- Question 6 gives programming problems on matrices, structures, and finding diagonal sums.
-
The document contains 6 programs written in C++ to perform various tasks involving arrays and conditional operators:
1) Three programs to swap two values using a third variable, without a third variable, and by adding and subtracting values.
2) Two programs to find the maximum and minimum of 10 values stored in an array.
3) A program to find the largest of two values using a conditional operator.
4) A program to find the smallest of three values using a conditional operator.
The document provides an outline and overview of key concepts in C++ basics, including variables and assignments, identifiers, keywords, input and output, data types and expressions, and arithmetic. It discusses how variables represent memory locations, how to declare and initialize variables of different data types like int, double, char, and bool, and how to perform input and output using cout and cin.
This document contains a list of 23 programming problems/exercises related to C++ concepts like arrays, functions, classes, files, and data structures. Some examples include:
1) Writing a function to swap elements between columns of a 2D array.
2) Defining classes for concepts like Queue, Stack, Hotel booking etc. with relevant member functions.
3) Writing SQL queries to retrieve/manipulate data from provided tables on items, students etc.
4) Considering classes like Player derived from Coach and solving related problems.
The document provides detailed descriptions and examples for each problem/exercise.
The document provides an overview of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented, and high-level programming language. It can be used to develop desktop and web applications. Popular applications built using Python include Instagram, Google, Dropbox, Yahoo Maps, Spotify, and Reddit. The document also covers Python variables, data types, operators, and basic control structures like if/else statements and while loops. It provides examples of how to write, run, and execute Python code in both interactive and script modes.
This document discusses functions, arrays, and structures in C++. It covers:
- Declaring and defining functions
- Passing arrays and structures as arguments to functions
- Returning arrays and structures from functions
- Using multidimensional arrays as function parameters
- Examples of functions that read/write arrays and structures
The document discusses classes and files in C++. It covers:
1) Classes in C++, including declaring classes, private, protected, and public members, and examples of classes.
2) Files in C++, including streams, reading from and writing to files, and the standard input/output streams.
3) Specific file classes in C++ - ifstream for input, ofstream for output, and fstream for both. It also covers opening files using the open() function.
The document contains the code for a menu driven C++ program that performs various operations on matrices such as calculating row and column sums, finding the transpose, and checking if two matrices are equal. It defines functions to perform these operations and contains a main function that inputs the matrices, displays a menu, and calls the appropriate functions based on the user's selection.
The document discusses user-defined data types in C++ including defined constants (#define), defining own types (typedef), constants (const), enumerations (enum), scope of variables, and structures (struct). The key objectives are to understand how to create user-defined data types.
The document discusses C++ strings and the string class. It covers string formats, the string class in the C++ standard library, string constructors, assigning and comparing strings, and input/output with strings using the insertion and extraction operators. It also covers using the getline function to read entire lines of input into string variables.
The document discusses function overloading in C++ and provides an example program to calculate the area of different shapes using function overloading. It then discusses constructors and destructors with examples and explains polymorphism with an example. Next, it discusses different types of inheritance in C++ and provides an example program to implement operator overloading for a distance class. It also discusses virtual functions with an example and access specifiers in classes. Finally, it provides examples to define a student class, implement quicksort using templates and overloading relational operators.
The document discusses procedural abstraction and predefined functions in computer programming. It provides examples of for loops and nested for loops to iterate through ranges of values. The for loop examples demonstrate how the initialization, boolean expression, and update components work together to execute the loop body. Tracing is used to step through multiple iterations of the for loops.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
The document contains a C++ code snippet that defines a class called TOYS. It has data members like ToyCode, ToyName, and AgeRange. It also has member functions like Enter() to input details, Display() to output details, and WhatAge() to return the AgeRange. The question asks to write a function to read TOYS objects from a binary file called TOYS.DAT and display details of toys meant for children aged "5 to 8".
The document contains 15 questions from previous year CBSE and other board exam papers related to C++ programming. Each question provides code snippets and asks to determine possible outputs, values of variables, minimum and maximum values etc. For each question, the correct answer is provided along with justification in 1-2 sentences where needed. The questions are testing concepts like random numbers, loops, arrays, functions etc. and ability to read code and analyze output.
This document appears to be a student project report submitted to a secondary school. It includes an acknowledgements section thanking guidance received. It also includes a certificate section signed by a computer science faculty member. The bulk of the document is an index listing 25 C++ programs with brief descriptions and signatures. The programs cover topics like arrays, sorting, functions, classes, pointers and file handling. In total, this report submitted a series of C++ programs to fulfill a school programming assignment.
C++11 introduced several new features for functions and lambdas including:
1. Lambda expressions that allow the definition of anonymous inline functions.
2. The std::function wrapper that allows functions and lambdas to be used interchangeably.
3. std::bind that binds arguments to function parameters for creating function objects.
These features improved support for functional programming patterns in C++.
Virtual functions allow functions in derived classes to override functions in base classes. When a base class pointer points to a derived class object, calling a virtual function through the pointer will call the derived class's version. This allows the same interface to behave differently based on the actual object. Virtual functions are useful for mathematical operations, where a base class defines an interface and derived classes perform specific calculations like addition, subtraction etc. depending on the object type pointed to by the base class pointer.
The document provides a model question paper for class 12 computer science. It contains 7 questions covering various topics like C++, OOPs, data structures, file handling, SQL, boolean algebra and networking. The paper has a total of 70 marks distributed across different sub-questions having 1, 2, 3 or 4 marks each. Detailed blueprints specifying the marks distribution across different units is also provided.
The summary provides the high level information from the document in 3 sentences:
The document contains a monthly test for Class XII CS with 20 multiple choice questions covering topics like C++ identifiers, header files, functions, classes, arrays, and searching algorithms. Students are asked to write code, find outputs, define functions, and describe concepts from object oriented programming and data structures. The questions progress from basic concepts to more advanced topics and require analytical thinking to understand programs, identify errors, define functions, and describe programming concepts.
This document contains questions from various years (2008-2012) related to object oriented programming concepts in C++. The questions cover topics such as classes and objects, inheritance, polymorphism, exception handling, functions, pointers, arrays, operators, input/output etc. Short questions ranging from 2-5 marks and long questions ranging from 5-10 marks are included related to concepts, syntax, programs and differences.
This document provides a sample paper for Class XII Computer Science. It includes two sections - Section A focused on C++ programming and Section B focused on Python programming. Each section contains multiple questions testing concepts like functions, classes, inheritance, file handling, arrays, and sorting/searching algorithms. Students are required to attempt either Section A or B, along with the compulsory Section C. The questions range from writing and analyzing code snippets to higher-level conceptual questions.
The document contains multiple code snippets and questions asking to find the output of each code. The code snippets demonstrate concepts like classes, structures, arrays, pointers and manipulating array/object values. The summaries provided would be:
1) The code demonstrates classes, objects and methods to concatenate state names and display the output.
2) Similar to the first problem, this code demonstrates classes, objects and methods to concatenate student names and display the output.
3) The code uses arrays, pointers and loops to manipulate array values and display the output.
4) This is another problem demonstrating similar concepts as the previous ones - arrays, pointers, loops and methods to manipulate values and display the output.
Cbse question paper class_xii_paper_2000Deepak Singh
This document contains the 2000 Delhi Board Computer Science question paper with C++. It has 7 questions covering topics like functions, classes, arrays, SQL, Boolean algebra, logic gates, and computer networks. Students had to write code, draw circuits, perform queries on a database, simplify Boolean expressions and more. It provides an overview of the scope and difficulty level of the C++ exam for that year.
This document contains a model question paper for Class XII Computer Science subject. It includes 6 questions covering various topics like C++, OOPs, Data Structures, File Handling, SQL, Boolean Algebra etc. A blue print is provided showing the distribution of topics and marks. Each question has various subparts with varying marks. Code snippets and problems are given to test the concepts.
The document contains examples demonstrating various object-oriented programming concepts in C++ including constructors, destructors, inheritance, polymorphism, operator overloading, templates, and more. Each example includes the code for a concept, the output of running the code, and a brief description.
This document provides an overview of C++ programming concepts including:
- Procedure-oriented programming focuses on tasks like reading, calculating and printing using functions, while object-oriented programming emphasizes data through objects and classes.
- C++ was developed to include object-oriented features while retaining C's simplicity, with classes, inheritance, and other features enabling abstract data types.
- Key concepts covered include classes, objects, member functions, inline functions, passing objects as parameters, returning objects, arrays of objects, and function overloading. Examples are provided to illustrate each concept.
The document discusses copy constructors in C++. It explains that a copy constructor is used to initialize an object from another object of the same class. It takes the other object as a reference parameter. The document provides an example class with a copy constructor that copies the member variables of one object to another. It also shows sample code that uses the copy constructor to make a copy of an object.
Presentation on C++ Programming Languagesatvirsandhu9
This document provides an overview of the C++ programming language. It discusses why C++ is used, how it compares to Fortran, and the basic structure and components of a C++ program. The key topics covered include data types, variables, operators, selection statements, iteration statements, functions, arrays, pointers, input/output, preprocessor instructions, and comments. The document is intended to teach the basics of C++ programming in a structured way over multiple sections.
This document provides several code snippets with syntax errors and the corrected code. The summaries are:
1) The document provides C++ code snippets with errors and the corrected code with the errors underlined. Various syntax errors like missing headers, incorrect function calls, and missing semicolons are provided along with the corrections.
2) For each code snippet, the full marks are awarded for correctly identifying and fixing all errors. Partial marks are awarded for identifying errors but not providing corrections or correcting some but not all errors.
3) The document tests knowledge of C++ syntax like headers, data types, functions, classes, and correcting common errors in code snippets. The corrected code is provided to check understanding of fixing syntax
The document discusses C++ concepts including classes, pointers, references, and memory management. It explains that C++ is an object-oriented superset of C with new features like classes, templates, and operator overloading. It also covers defining classes with headers and source files, using pointers to dynamically allocate memory with new and delete, the role of destructors, and differences between passing by value versus passing by reference.
This document contains code snippets for 12 common C++ programs: 1) checking if a number is even or odd, 2) swapping two numbers, 3) checking if a year is a leap year, 4) sorting words in dictionary order, 5) calculating a factorial, 6) generating a Fibonacci series, 7) transposing a matrix, 8) using constructors and destructors, 9) demonstrating multiple inheritance, 10) using static members and functions, 11) exception handling, and 12) file input/output. Each code snippet is followed by sample input/output to demonstrate the program's functionality.
This document provides a marking scheme for a Computer Science exam for Class XII. It includes instructions, 6 sections (A through C), and multiple choice questions with parts. Section A focuses on C++ programming, Section B on Python, and Section C is compulsory for all students. Questions assess topics like functions, OOPs concepts, arrays, file handling, and more. For each part, the number of marks and what is required are specified. Sample code is provided to test understanding of concepts like data abstraction, inheritance, operator overloading and more.
C++ is an object-oriented programming language that is based on classes and objects. A C++ program is made up of classes, which contain methods and variables. The basic building block of a C++ program is the class. A class defines the structure and behavior of an object. Objects are instances of classes that contain their own set of properties and behaviors. The main() method acts as the entry point for program execution. C++ supports features like functions, arrays, control statements, strings and more.
The document contains 21 code snippets showing examples of various Java programming concepts. The code snippets cover topics such as classes and objects, inheritance, interfaces, exceptions, threads, applets, packages, input/output, and networking.
The document discusses constructors and destructors in C++ classes. It provides examples of constructor definitions and errors. It explains the purpose and behavior of default, parameterized, and copy constructors. It also discusses the characteristics and purpose of constructors and destructors.
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docxrafbolet0
Spring 2014 CSCI 111 Final exam � of �1 6
1. (2 points) Flip over this test. On the back of this test write your name in the upper, left-hand
corner.
2. (2 points) What are the four parts of the compiling process (just give me 4 words, not a
paragraph).
3. (4 points) Which of the four steps of the compiling process occurs only once, regardless of
the number of source files your application has?
4. (4 points) Write a line of code that causes the preprocessor to generate an error.
5. (4 points) Write a line of code that causes the compiler to generate an error.
6. (5 points) Describe how you could incorrectly compile the joust project to cause the linker to
generate an error.
7. (5 points) Given:
1 float* fp;
2 //...
3 float pi;
4 pi=*(314 + fp);
Rewrite line 4 using array subscript notation.
Spring 2014 CSCI 111 Final exam � of �2 6
8. (5 points) Given:
1 float arr[100];
2 for(int x=0; x<100; ++x)
3 arr[x]=100-x;
What does the following expression print out?
cout << *arr << endl;
9. (14 points) Given:
int a=0;
int b=6;
int x=0;
Circle each if-expression that evaluates to true:
A) if(b)
B) if(x)
C) if(a=b==6)
D) if(a=b==5)
E) if(a=b=5)
F) if(a=x=0)
G) if(a=x==0)
Spring 2014 CSCI 111 Final exam � of �3 6
10. (10 points) Given:
1 #include<iostream>
2 using namespace std;
3
4 int main()
5 {
6 int x;
7 cout << "Enter a number greater than 10" << endl;
8 while ( x < 10 )
9 {
10 cin >> x;
11 }
12 return 0;
13 }
This program compiles just fine, and sometimes it runs as expected. But sometimes when you
run it, it exits immediately after printing "Enter a number greater than 10". That is, the program
doesn't pause for you to enter a number. Why are you getting this inconsistent behavior?
11. (4 points) What is the output of the following:
int x=4;
int y=3;
A) cout << x / y << endl;
B) cout << x % y << endl;
C) cout << x << "%" << y << endl;
D) cout << "x" << '%' << 'y' << endl;
Spring 2014 CSCI 111 Final exam � of �4 6
12. (16 points) What is the type of the expression. That is, what is the kind of thing that each
expression evaluates to. For example:
3 + 4 integer
You may assume that the variable a has been declared as an integer.
A. a + 4
B. a = 4
C. 3.14 + 4.49
D. 3 + 3.14
E. 'a'
F. cout << a
G. new float[30]
H. new float
Spring 2014 CSCI 111 Final exam � of �5 6
13. (5 points) Write a for-loop that prints out the numbers between 1 and 100 that are evenly
divisible by three.
14. (5 points) Write a while-loop that prints out the numbers between 1 and 100 that are evenly
divisible by three.
15. (5 points) Write a do-while-loop that prints out the numbers between 1 and 100 that are
evenly divisible by three.
Spring 2014 CSCI 111 Final exam � of �6 6
16. (10 points) Given:
1 #include<iostream>
2
3 class Willow {
4 publi.
Computer networks - CBSE New Syllabus (083) Class - XIIDeepak Singh
The document provides information on various computer networking concepts. It defines Internet of Things (IoT) and discusses the differences between public and private clouds. It also describes wired and wireless networks, the roles of clients and servers, and common networking hardware like NICs, switches, routers and access points. The document further explains networking protocols and standards such as IP versions, DNS, URLs, modulation techniques, and communication protocols like HTTP, FTP, SMTP and more.
The document discusses basic file input/output operations in C++, including reading from and writing to text files, counting characters, words, and lines. It also covers binary file operations such as creating binary files, reading from and writing to binary files, searching, deleting, and modifying records in binary files using classes. Example C++ programs are provided to demonstrate each operation.
This document discusses file handling in C++. It defines text and binary files, and describes classes like ofstream, ifstream, and fstream that are used for file input/output. It explains how to open, close, read from, and write to files, and describes functions for input/output of single characters and blocks of data. It also covers error handling functions and manipulating file pointers using methods like seekg() and seekp().
1) A base class pointer can point to a derived class object but cannot access the derived class's additional functions without a cast.
2) Declaring a function as virtual in the base class allows it to be overridden in derived classes and called polymorphically through a base class pointer.
3) A pure virtual function is like an abstract function that derived classes must implement. A class with a pure virtual function is an abstract class that cannot be instantiated.
The compiler automatically calls the base class constructor before the derived class constructor. You can specify which base class constructor to call by passing arguments to it in the derived class constructor definition. A derived class can override a base class member function by defining a function of the same name and parameters in the derived class. To call the overridden base class function, use the scope resolution operator to specify the base class. Making a base class virtual prevents duplication of inherited members when it is used as a common ancestor in multipath inheritance.
Inheritance allows classes to extend existing classes without modifying them. A derived class inherits features from its base class and can define new features. There are different types of inheritance including single, multiple, hierarchical, and multilevel inheritance. When deriving a class, the member access specifier (public, private, protected) determines how members of the base class appear in the derived class. The example shows Shape as the base class and Rectangle and Triangle as derived classes that inherit properties like width and height while defining their own area calculation methods.
Operator overloading allows redefining the behavior of operators when used with user-defined types like classes. It is done by defining a member function named operator followed by the symbol, like operator+. The code shows overloading the + operator for a Complex number class to add the real and imaginary parts of two Complex objects when using +. This allows calling the addition like c3 = c1 + c2 instead of c1.operator+(c2).
Friend functions and classes allow external code to access private members of a class. The document demonstrates declaring a function and class as friends of the Rectangle class to access its private length and width variables. This is done by specifying the function or class as friend within the class definition. This allows the friend function getCost() and class CostCalculator to multiply length and width to calculate the area or cost despite them being private members.
Static members allow data or methods to be accessed by all objects of a class. Static data members are declared within a class but defined and initialized outside the class. A static data member exists in a single copy shared by all instances of the class. Static member functions can access only static data and cannot access non-static data or call non-static methods. Static functions can be called without an object and are used to access static data.
The document discusses separating a class definition into header and implementation files to make the class reusable. The class declaration is defined in a header file with a .h extension, member functions are defined in a cpp file with the same name and a .cpp extension, and a main.cpp file includes the header and contains the main function to test the class. This separation allows the class interface to be shared while hiding implementation details.
This document discusses a Time class case study that demonstrates C++ class construction features. It includes a Time class definition with constructors, setter functions, a print function, and an equals function to compare two Time objects. The main function creates Time objects, calls the print and equals functions to output the time values. The document then discusses additional OOP concepts like default constructor arguments, constant functions, constant parameters, and passing objects by reference.
This document discusses constructors and destructors in C++. It defines three types of constructors: default constructors, parameterized constructors, and copy constructors. Default constructors accept no parameters and initialize object fields to default values. Parameterized constructors accept arguments to initialize fields. Copy constructors initialize an object using the values of another object. Destructors are invoked when an object's scope ends to destroy the object. The example demonstrates defining these methods in a Circle class and invoking them to initialize objects with different constructors.
Classes allow you to combine data and functions into a single unit called an object. A class defines the type, while an object is a variable of that class type. Classes contain private, protected, and public members that control access levels. Private members can only be accessed within the class, protected within the class and subclasses, and public anywhere. An example class Circle contains private data member radius and public member functions setRadius() and getArea() to set and get the radius. Objects can then be declared like Circle c1, c2 and their member functions accessed such as c1.setRadius(2.5).
Procedural programming separates data and functions, which can cause problems for large complex programs. Object-oriented programming combines data and procedures into objects, encapsulating them together. An object's attributes are stored in member variables and its procedures are member functions. This encapsulation also allows for data hiding so only an object's own functions can access and change its internal data. Some advantages of OOP include easier management of complex software, simple upgrades, and partitioning work based on objects.
Pointer variables hold the memory address of another variable. Pointers allow accessing and modifying the value of the variable being pointed to. Pointers can be used to access elements of an array using pointer arithmetic. Dynamic memory allocation uses pointers and the new operator to allocate memory at runtime that is freed using delete. Pointer parameters allow changing the argument passed to a function. Pointers to structures can access members using -> or (*ptr).member syntax.
The document discusses different data structures in C++ including structures, nested structures, typedef, enumerated data types, and macros. It explains that a structure allows grouping of related data types under one name and can be treated as a user-defined data type. It provides examples of declaring structure variables, defining members, and accessing members. Nested structures allow structures to be members of other structures. Typedef provides an alternative name for standard data types. Enumerated data types define a set of names mapped to integer constants. Macros allow defining symbolic names and constants using the #define preprocessor directive.
The document discusses two-dimensional arrays in C++. It explains that a two-dimensional array is an array of arrays, with elements arranged in rows and columns. It provides examples of declaring, initializing, accessing, inputting, and passing two-dimensional arrays as parameters to functions. It also gives examples of functions that perform operations on two-dimensional arrays, such as addition, multiplication, finding row/column sums, diagonal sums, and transposing the array.
An array is a collection of elements of the same data type. It can be initialized with values specified in braces when declared. Individual array elements can be accessed using the array name and subscript index. Arrays can be passed as parameters to functions by passing the array name without brackets. Basic operations on arrays include traversing, searching, sorting, and merging elements.
Functions allow programmers to organize code into reusable blocks. A function performs a specific task and can accept input parameters and return an output. Functions make code more modular and easier to maintain. Functions are defined with a name, parameters, and body. They can be called from other parts of the code to execute their task. Parameters allow functions to accept input values, while return values allow functions to return output to the calling code. Functions can be called by passing arguments by value or reference. The document provides examples and explanations of different types of functions in C++ like inline functions, functions with default arguments, and global vs local variables.
The C++ Standard Library provides functions for common tasks like math, strings, I/O, and more. It includes header files that replace older C-style headers. Key headers include <iostream> for I/O, <cmath> for math functions, and <cctype> for character functions. Functions cover tasks from calculating sines and cosines to converting cases and checking digit/letter types. The Standard Library makes programming easier by providing these useful and necessary capabilities.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Building Production Ready Search Pipelines with Spark and Milvus
Cbse question-paper-computer-science-2009
1. COMPUTER SCIENCE-2009
Time allowed : 3hours] [Maximum Marks :70
Instructions (i) All questions are compulsory
(ii) Programming Language : C++
1. (a) What is the difference between call by value and call by reference? Give an
example in C++ to illustrate both. 2
(b) Write the names of the header files to which the following belong:
(i) puts( ) (ii) sin( ) 1
(c) Rewrite the following program after removing the syntactical error(s) (if any).
Underline each correction. 2
#include [iostream.h]
#include [stdio.h]
class Employee
{
int EmpId=901;
char EName[20];
public
Employee( ) { }
void Joinint( ) { cin>>EmpId; gets(EName); }
void List( ) { cout<<EmpId<<“:”<<EName<<endl;}
};
void main( )
{
Employee E;
Joining.E( );
E.List( )
}
(d) Find the output of the following program:
3
#include<iostream.h>
void main()
{
int X[]={10,25,30,55,110};
int *p=X;
while(*p<110)
{
if(*p%3!=0)
*p=*p+1;
1 www.cppforschool.com
2. else
*p=*p+2;
p++;
}
for(int I=4;I>=1;i--)
{
cout<<X[I]<<”*”;
if(I%3==0) cout<<endl;
}
cout<<X[0]*3<<endl;
}
e) Find the output of the following program : 2
#include<iostream.h>
#include<ctype.h>
void Encode(char Info[ ], int N);
void main( )
{
char Memo[ ] = “Justnow”;
Encode(Memo,2);
cout<<Memo<<endl;
}
void Encode(char Info[ ], int N)
{
for (int I=0,Info[I]!=‟0‟;I++)
if (I%2==0)
Info[I]=Info[I]-N;
else if (islower(Info[I]))
Info[I] = toupper(Info[I]);
else
Info[I]=Info[I]+N;
}
(f) Study the following program and select the possible output from it: 2
#include<iostream.h>
#include<stdlib.h>
void main( )
{
randomize( );
int Points;
Points = 100 + random(LIMIT);
for (int P=Points; P>=100;P--)
cout<<P<<“#”;
cout<<endl;
}
2 www.cppforschool.com
3. (i) 103#102#101#100#
(ii) 100#101#102#103#
(iii) 100#101#102#103#104#
(iv) 104#103#102#101#100#
2. (a) What is copy constructor? Give an example in C++ to illustrate copy constructor. 2
(b) Answer the question (i) and (ii) after going through the following class : 2
class WORK
{
int WorkId; char WorkType;
public:
~WORK( ) //Function 1
{
cout<<“Un-Allocated”<<endl;
}
void Status( ) // Function 2
{
cout<<WorkId<<“:”<<WorkType<<endl;
}
WORK( ) // Function 3
{
WorkId=10; WorkType=‟T‟;
}
WORK (WORK &W) // Function 4
{
WorkId = W.WorkId+12; WorkType=W.WorkType+1;
}
};
(i) Which member function out of Function 1, Function 2, Function 3 and Function 4
shown in the above definition of class Work is called automatically, when the
scope of an object gets over? Is it known as Constructor OR Destructor OR
Overloaded Function OR Copy Constructor?
ii) WORK W; //Statement 1
WORK Y(W); // Statement 2
Which member function out of Function 1, Function 2, Function 3 and Function 4
shown in the above definition of class Work will be called on execution of
statement written as Statement 2? What is this function specifically known as out
of Destructor or Copy Constructor or Default Constructor?
(c) Define a class RESORT in C++ with following description: 4
Private Members:
Rno // Data member to store Room No
3 www.cppforschool.com
4. Name // Data member to store customer name
Charges // Data member to store per day charges
Days // Data member to store number of days of stay
COMPUTE( ) // A function to calculate and return Amount as
Days* Charges and if the value of Days * Charges
is more than 11000 then as 1.02 * Days * Charges
Public Members :
Getinfo( ) // A function to enter the content Rno, Name, Charges and Days
Dispinfo( ) // A function to display Rno, Name, Charges, Days and Amount
(Amount to be displayed by calling function COMPUTE( ) )
(d) Answer the questions (i) to (iv) based on the following: 4
class FaceToFace
{
char CenterCode[10];
public:
void Input( );
void Output( );
};
class Online
{
char website[50];
public:
void SiteIn( );
void SiteOut( );
};
class Training: public FaceToFace, private online
{
long Tcode;
float charge;
int period;
public:
void Register( );
void show( );
};
(i) Which type of inheritance is shown in the above example?
(ii) Write names of all the member functions accessible from Show( ) function of
class Training.
(iii) Write name of all the member accessible through an object of class Training.
(iv) Is the function Output( ) accessible inside the function SiteOut( )? Justify
your answer?
3 (a) Write a function SORTPOINTS( ) in C++ to sort an array of structure Game in
descending order of Points using Bubble Sort.
4 www.cppforschool.com
5. Note: Assume the following definition of structure Game
Struct Game
{
long Pno; // Player Number
char PName[20];
long Points;
};
Sample Content of the array (before sorting)
PNo Pname Points
103 Ritika Kapur 3001
104 John Philip 2819
101 Razia Abbas 3451
105 Tarun Kumar 2971
Sample Content of the array (after sorting)
Pno Pname Points
101 Razia Abbas 3451
103 Ritika Kapur 3001
105 Tarun Kumar 2971
104 John Philip 2819
(b) An array S[40][30] is stored in the memory along the column with each of the
element occupying 4 bytes, find out the base address and address of element
S[20][15], if an element S[15][10] is stored at the memory location 7200. 4
(c) Write a function QUEINS( ) in C++ to insert an element in a dynamically
allocated Queue containing nodes of the following given structure: 4
struct Node
{
int PId; // Product Id
char Pname[20];
NODE *Next;
};
(d) Define a function SWAPCOL( ) in C++ to swap (interchange) the first column
elements with the last column elements, for a two dimensional integer array
passed as the argument of the function. 3
Example: If the two dimensional array contains
2 1 4 9
1 3 7 7
5 8 6 3
7 2 1 2
5 www.cppforschool.com
6. After swapping of the content of 1st column and last column, it should be:
9 1 4 2
7 3 7 1
3 8 6 5
2 2 1 7
(e) Convert the following infix expression to its equivalent postfix expression
showing stack contents for the conversion: 2
X - Y / (Z + U) * V
4 (a) Observe the program segment given below carefully and fill the blanks marked as
Line 1 and Line 2 using fstream functions for performing the required task. 1
#include<fstream.h>
class Stock
{
long Ino; // Item Number
char Item[20]; // Item Name
int Qty; // Quantity
public:
void Get(int);
Get(int);// Function to enter the content
void Show( ); // Function to display the content
void Purchase(int Tqty)
{
Qty+ = Tqty; // Function to increment in Qty
}
long KnowIno( )
{ return Ino;}
};
void Purchaseitem(long PINo, int PQty)
// PINo -> Info of the item purchased
// PQty -> Number of items purchased
{
fstream file;
File.open(“ITEMS.DAT”,ios::binary|ios::in|ios::cut);
int Pos=-1;
Stock S;
while (Pos== -1 && File.read((char*)&S, sizeof(S)))
if (S.KnowInc( ) == PINo)
{
S.Purchase(PQty); // To update the number of items
Pos = File.tellg()- sizeof(S);
//Line 1 : To place the file pointer to the required position
6 www.cppforschool.com
7. ______________________________________;
//Line 2 : To write the objects on the binary file
______________________________________;
}
if (Pos == -1)
cout<<“No updation done as required Ino not found...”;
File.close( );
}
(b) Write a function COUNT_DO( ) in C++ to count the presence of a word „do‟ in a
text file “MEMO.TXT”. 2
Example :
If the content of the file “MEMO.TXT” is as follows:
I will do it, if you
request me to do it.
It would have been done much
earlier.
The function COUNT_DO( ) will display the following message:
Count of -do- in flie: 2
(c) Write a function in C++ to read and display the detail of all the users whose status
is „A‟ (i.e. Active) from a binary file “USER.DAT”. Assuming the binary file
“USER.DAT” is containing objects of class USER, which is defined as follows:
class USER
{
int Uid; // User Id
char Uname[20]; // User Name
char Status; // User Type: A Active I Inactive
public:
void Register( ); // Function to enter the content
void show( ); // Function to display all data members
char Getstatus( )
{
return Status;
}
};
5 (a) What are candidate keys in a table? Give a suitable example of candidate keys in
a table. 2
(b) Consider the following tables GARMENT and FABRIC. Write SQL commands
for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) 6
7 www.cppforschool.com
8. Table: GARMENT
GCODE DESCRIPTION PRICE FCODE READYDATE
10023 PENCIL SKIRT 1150 F03 19-DEC-08
10001 FORMAL SHIRT 1250 F01 12-JAN-08
10012 INFORMAL SHIRT 1550 F02 06-JAN-08
10024 BABY TOP 750 F03 07-APR-07
10090 TULIP SKIRT 850 F02 31-MAR-07
10019 EVENING GOWN 850 F03 06-JUN-08
10009 INFORMAL PANT 1500 F02 20-OCT-08
10007 FORMAL PANT 1350 F01 09-MAR-08
10020 FROCK 850 F04 09-SEP-07
10089 SLACKS 750 F03 31-OCT-08
Table: FABRIC
FCODE TYPE
F04 POLYSTER
F02 COTTON
F03 SILK
F01 TERELENE
(i) To display GCODE and DESCRIPTION of each GARMENT in descending order
of GCODE
(ii) To display the details of all the GARMENTs, which have READYDATE in
between 08-DEC-07 and 16-JUN-08 (inclusive of both the dates).
(iii) To display the average PRICE of all the GARMENTs, which are made up of
FABRIC with FCODE as F03.
(iv) To display FABRICwise highest and lowest price of GARMENTs from
GARMENT table. (Display FCODE of each GARMENT along with highest and
lowest price).
(v) SELECT SUM(PRICE) FROM GARMENT WHERE FCODE=‟F01‟;
(vi) SELECT DESCRIPTION, TYPE FROM GARMENT, FABRIC WHERE
GARMENT.FCODE =FABRIC.FCODE AND GARMENT.PRICE > = 1260;
(vii) SELECT MAX(FCODE) FROM FABRIC;
(viii) SELECT COUNT (DISTINCT PRICE) FROM GARMENT;
6 (a) Verify X‟Y + X.Y‟ + X‟.Y‟ = (X‟+Y‟) using truth table. 2
(b) Write the equivalent Boolean Expression for the following Logic Circuit: 2
8 www.cppforschool.com
9. (c) Write the POS form of a Boolean Function H, which represented in a truth table
as follows: 2
A B C H
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
(d) Reduce the following Boolean Expression using K-Map:
F(P, Q, R, S) = (1, 2, 3, 5, 6, 7, 9, 11, 12, 13, 15) 3
7 (a) What is the difference between STAR topology and BUS topology of network?
(b) Expand the following abbreviations: 2
(i) GSM (ii) CDMA
(c) What is protocol? Which protocol is used to search information from Internet using
the Internet Browser? 1
(d) Name two switching techniques used to transfer data between two terminals
(computers). 1
(e) Freshminds University of India is starting its first campus in Ana Nagar of South
India with its center admission office in Kolkata. The University has 3 major blocks
comprising of office block, science block and commerce block in the 5 KM area
campus. 4
As a network experts, you need to suggest the network plan as per (E1) to (E4) to the
authorities keeping in mind the distances and other given parameters. Expected Wire
distances between various locations:
Office Block to Science Block 90 m
Office Block to Commerce Block 80 m
Science Block to Commerce Block 15 m
Kolkata Admission Office to Ana Nagar Campus 2450 KM
9 www.cppforschool.com
10. Expected number of Computers to be installed at various locations in the university are
as follows:
Office Block 10
Science Block 140
Commerce Block 30
Kolkata Admission Office 8
(E1) Suggest the authorities, the cable layout amongst various blocks inside university
campus for connecting the blocks.
(E2) Suggest the most suitable place (i.e. block) to house the server of this university
with a suitable reason.
(E3) Suggest an efficient device from the following to be installed in each of the blocks
to connect all the computers:
(i) MODEM
(ii) SWITCH
(iii) GATEWAY
(E4) Suggest the most suitable (very high speed) device to provide data connectivity
between Admission Office located in Kolkata and the Campus located in Ana
Nagar from the following options:
- Telephone Line
- Fixed- Line Dial-up connection
- Co-axial Cable Network
- GSM
- Leased Line
- Satellite Connection
----------------------------------- www.cppforschool.com --------------------------------
10 www.cppforschool.com