This document contains 22 code programs submitted by Ankit Dixit to his instructor Ms. Achhardeep Kaur for her class. The programs demonstrate various C++ concepts like conditional statements, loops, functions, arrays, pointers, structures, classes and objects. Example programs include checking if a number is even or odd, finding the greatest of three numbers, generating the Fibonacci series, and calculating the area of a rectangle using a class.
Object Oriented Programming Using C++ Practical FileHarjinder Singh
This document contains a practical file submitted by Jasbir Singh for an Object Oriented Programming course using C++. It includes an acknowledgement page thanking various people for their support and guidance. The document then provides a table of contents listing 53 programs with their page numbers and brief descriptions. The programs demonstrate various C++ concepts like classes, objects, inheritance, polymorphism, operator overloading and more.
The document describes programs to implement various operations on singly linked lists including insertion, deletion, counting nodes, creating a list, traversing a list, and copying a list. It provides functions for insertion at the beginning, end, and before/after a given node. Deletion functions remove from the beginning, end, or by item value. Counting returns the total nodes or occurrences of a value. Traversal and copying print or duplicate the list.
This document contains 17 programming problems and their solutions involving object oriented programming concepts like classes, objects, functions, arrays, pointers etc. The problems cover basic concepts like calculating factorial, checking prime number, Fibonacci series, arithmetic operations using menus. More advanced concepts covered include sorting, searching, function overloading, complex numbers, class/object concepts like constructors, destructors and member functions to maintain student records.
Functions allow programmers to structure C++ programs into modular segments of code to perform individual tasks. There are two types of functions: library functions and user-defined functions. User-defined functions are defined using a return type, function name, and parameters. Functions can be called by value or by reference and can also be inline, recursive, or friend functions.
Chapter 1 : Balagurusamy_ Programming ANsI in C BUBT
This document contains 15 programming problems and their solutions in C language from Chapter 1 of the book "Solution Programming in ANSI C" by Balagurusamy. The problems cover basic C programming concepts like input/output, arithmetic operations, conditional statements, loops, functions, arrays and structures. Each problem is presented with the coding, inputs provided, and expected output. The problems increase in complexity from simple text printing to calculating area of shapes to solving equations.
The document contains 10 C++ programs that demonstrate various programming concepts like arithmetic operators, if-else statements, loops, arrays, etc. Each program is presented with its source code and expected output.
Object Oriented Programming Using C++ Practical FileHarjinder Singh
This document contains a practical file submitted by Jasbir Singh for an Object Oriented Programming course using C++. It includes an acknowledgement page thanking various people for their support and guidance. The document then provides a table of contents listing 53 programs with their page numbers and brief descriptions. The programs demonstrate various C++ concepts like classes, objects, inheritance, polymorphism, operator overloading and more.
The document describes programs to implement various operations on singly linked lists including insertion, deletion, counting nodes, creating a list, traversing a list, and copying a list. It provides functions for insertion at the beginning, end, and before/after a given node. Deletion functions remove from the beginning, end, or by item value. Counting returns the total nodes or occurrences of a value. Traversal and copying print or duplicate the list.
This document contains 17 programming problems and their solutions involving object oriented programming concepts like classes, objects, functions, arrays, pointers etc. The problems cover basic concepts like calculating factorial, checking prime number, Fibonacci series, arithmetic operations using menus. More advanced concepts covered include sorting, searching, function overloading, complex numbers, class/object concepts like constructors, destructors and member functions to maintain student records.
Functions allow programmers to structure C++ programs into modular segments of code to perform individual tasks. There are two types of functions: library functions and user-defined functions. User-defined functions are defined using a return type, function name, and parameters. Functions can be called by value or by reference and can also be inline, recursive, or friend functions.
Chapter 1 : Balagurusamy_ Programming ANsI in C BUBT
This document contains 15 programming problems and their solutions in C language from Chapter 1 of the book "Solution Programming in ANSI C" by Balagurusamy. The problems cover basic C programming concepts like input/output, arithmetic operations, conditional statements, loops, functions, arrays and structures. Each problem is presented with the coding, inputs provided, and expected output. The problems increase in complexity from simple text printing to calculating area of shapes to solving equations.
The document contains 10 C++ programs that demonstrate various programming concepts like arithmetic operators, if-else statements, loops, arrays, etc. Each program is presented with its source code and expected output.
1. Perform Linear Search and Binary Search on an array.
Descriptions of the programs:
Read and array of type integer.
Input element from user for searching.
Search the element by passing the array to a function and then returning the position of the element from the function else return -1 if the element is not found.
Display the positions where the element has been found.
2. Implement sparse matrix using array.
Description of program:
Read a 2D array from the user.
Store it in the sparse matrix form, use array of structures.
Print the final array.
3. Create a linked list with nodes having information about a student and perform.
Description of the program:
Insert a new node at specified position.
Delete of a node with the roll number of student specified.
Reversal of that linked list.
4. Create doubly linked list with nodes having information about an employee and perform Insertion at front of doubly linked list and perform deletion at end of that doubly linked list.
5. Create circular linked list having information about a college and perform Insertion at front perform Deletion at end.
6. Create a stack and perform Pop, Push, Traverse operations on the stack using Linear Linked list.
7. Create a Linear Queue using Linked List and implement different operations such as Insert, Delete, and Display the queue elements.
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.
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)Make Mannan
This document provides a lab manual for experiments on data structures. It includes 20 experiments covering topics like arrays, matrices, recursion, strings, stacks, queues, linked lists, trees, graphs and sorting algorithms. Each experiment contains the aim, introduction, source code, sample output and questions. The experiments provide hands-on practice with commonly used data structures and algorithms.
The document contains 34 code snippets showing C programming examples using arrays, loops, functions, conditional statements, and other basic programming concepts. The code snippets demonstrate how to:
1) Print messages, take user input, perform basic math operations like addition and averaging numbers
2) Check conditions like even/odd, positive/negative, leap year
3) Use different loops like while, for, do-while to iterate
4) Define and call functions to modularize code for swapping, factorial, Fibonacci series etc.
5) Use one-dimensional arrays to store and process data
This document discusses different types of functions in C programming. It explains that functions can be predefined standard library functions or user-defined functions. It provides examples of functions with no return type and no arguments, functions with no return type but arguments, and functions with a return type but no arguments. The syntax for defining, declaring, and calling functions is also demonstrated.
The document discusses inline functions in C++. It explains that inline functions are replaced by their function code during compilation so they run faster than regular functions but use more memory. It provides examples of declaring and defining inline functions and demonstrates how an inline function call is handled at runtime by replacing it with the function statements. The document also discusses making member functions inline within a class declaration.
An operator is a symbol designed to operate on data.
They can be a single symbol, di-graphs, tri-graphs or keywords.
Operators can be classified in different ways.
This is similar to function overloading
This document contains 24 C++ programs with explanations and sample outputs. The programs cover basic concepts like variable declaration and input/output, conditional statements, loops, functions, arrays and structures. The programs include calculating area and circumference of shapes, finding largest/smallest numbers, checking leap years, calculating electricity bills, compound interest, digit sum, palindrome checking and more. The programs are meant as examples for students to practice and learn C++ programming.
This presentation describes demerits of infix expressions for compiler, algorithm to convert given infix expression to postfix expression using stacks in Data Struictures along with several example solutions. It also contains program of stack ADT using <stack> STL.
This document discusses templates in C++. Templates allow functions and classes to work with multiple data types without writing separate code for each type. There are two types of templates: class templates, which define a family of classes that operate on different data types, and function templates, which define a family of functions that can accept different data types as arguments. Examples of each template type are provided to demonstrate how they can be used to create reusable and flexible code.
Chapter 4 : Balagurusamy Programming ANSI in CBUBT
The document contains solutions to programming problems from the book "C Programming: Chapter-4" by E. Balagurusamy. It includes problems on input/output operators like scanf() and printf(), reading and displaying data in various formats, rounding numbers, bar charts, multiplication tables, and formatting output. Each problem has the code snippet to solve it along with sample input/output. The solutions demonstrate proper use of scanf(), printf(), and formatting specifiers to handle different data types and formats.
The document provides an overview of references and pointers in C++. References act as aliases for objects without copying them, while pointers store the address of an object and require dereferencing. References must be initialized and cannot be changed or null, whereas pointers can be null and changed. Const references and pointers promise not to modify an object.
This document discusses pointers in C++. It defines pointers as variables that store memory addresses and can be used to access and manipulate data at those addresses. It explains how to declare and initialize pointers, including pointer to pointer declarations. It discusses using pointers as function arguments and dynamic memory allocation using pointers with the new and delete operators. Pointers allow referencing variables indirectly and allocating memory dynamically at runtime.
Two dimensional arrays in C can be declared and initialized similarly to one dimensional arrays, with the first subscript specifying the row and second subscript specifying the column. Elements are stored in contiguous memory locations in row-major order. The document then presents a sample problem of reading a 2D array of integers from a file, finding the largest element, and printing it out. It also discusses using typedef to define custom data types like matrices and strings.
Static Data Members and Member FunctionsMOHIT AGARWAL
Static data members and static member functions in C++ classes are shared by all objects of that class. Static data members are initialized to zero when the first object is created and shared across all instances, while static member functions can only access other static members and are called using the class name and scope resolution operator. The example program demonstrates a class with a static data member "count" that is incremented and accessed by multiple objects to assign increasing code values, and a static member function "showcount" that prints the shared count value.
CONSTRUCTOR AND DESTRUCTOR PPT BASED ON OOP SUBJECT ......FULLY CONCEPT EXPLAINED WITH SAMPLE PROGRAM IN IT .....FOR MORE SLIDES PLEASE FOLLOW ME ..... THANK YOU
This document provides an overview of string manipulation in C++. It discusses C-style strings and introduces C++ strings as objects of the string class. It describes various string constructors, functions for comparison, concatenation, insertion, extraction and other operations. Examples are given to demonstrate the use of functions like length(), capacity(), empty(), at(), find(), assign(), begin() and end(). The document is intended as a lecture on object-oriented string handling in C++.
This document contains instructions for several Java programming exercises involving classes, packages, inheritance, overriding, exceptions, and threads. It outlines code for programs that demonstrate concepts like classes and objects, command line arguments, bitwise operators, method overriding, and packages. For each exercise, it provides the aim, algorithm, sample code, input/output, and result to verify the output. The exercises are intended to help students learn and practice core Java programming concepts.
The document discusses key concepts related to functions in C programming including:
- Functions take input, perform operations, and return output. The main() function is required.
- Function prototypes declare a function's name, return type, and arguments before use.
- Function definitions specify the return type, name, arguments, and function body.
- Arguments are passed by value by default, but can be passed by reference using pointers.
- Recursive functions call themselves with different argument values until a base case is reached.
- Variables can have different scopes like global, file, local, and block depending on where they are declared. Static variables retain their value between function calls.
Here is a program to calculate the area of a ring using functions:
#include <iostream>
using namespace std;
// Function to calculate area of ring
double areaOfRing(double innerRadius, double outerRadius) {
return (M_PI * (outerRadius * outerRadius - innerRadius * innerRadius));
}
int main() {
double innerRadius, outerRadius;
// Get input from user
cout << "Enter inner radius of ring: ";
cin >> innerRadius;
cout << "Enter outer radius of ring: ";
cin >> outerRadius;
// Call function to calculate area
double area = areaOfRing(innerRadius, outerRadius);
//
This document contains 17 programming problems and their solutions involving object oriented programming concepts like classes, objects, functions, arrays, pointers etc. The problems cover basic concepts like calculating factorial, checking prime number, Fibonacci series, arithmetic operations using menus, finding largest element in array. More advanced concepts covered are bubble sort, selection sort, function overloading to calculate area of shapes, complex number addition using friend functions, student record management using classes. Overall, the document aims to provide practice on common OOP concepts through solving different programming problems.
1. Perform Linear Search and Binary Search on an array.
Descriptions of the programs:
Read and array of type integer.
Input element from user for searching.
Search the element by passing the array to a function and then returning the position of the element from the function else return -1 if the element is not found.
Display the positions where the element has been found.
2. Implement sparse matrix using array.
Description of program:
Read a 2D array from the user.
Store it in the sparse matrix form, use array of structures.
Print the final array.
3. Create a linked list with nodes having information about a student and perform.
Description of the program:
Insert a new node at specified position.
Delete of a node with the roll number of student specified.
Reversal of that linked list.
4. Create doubly linked list with nodes having information about an employee and perform Insertion at front of doubly linked list and perform deletion at end of that doubly linked list.
5. Create circular linked list having information about a college and perform Insertion at front perform Deletion at end.
6. Create a stack and perform Pop, Push, Traverse operations on the stack using Linear Linked list.
7. Create a Linear Queue using Linked List and implement different operations such as Insert, Delete, and Display the queue elements.
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.
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)Make Mannan
This document provides a lab manual for experiments on data structures. It includes 20 experiments covering topics like arrays, matrices, recursion, strings, stacks, queues, linked lists, trees, graphs and sorting algorithms. Each experiment contains the aim, introduction, source code, sample output and questions. The experiments provide hands-on practice with commonly used data structures and algorithms.
The document contains 34 code snippets showing C programming examples using arrays, loops, functions, conditional statements, and other basic programming concepts. The code snippets demonstrate how to:
1) Print messages, take user input, perform basic math operations like addition and averaging numbers
2) Check conditions like even/odd, positive/negative, leap year
3) Use different loops like while, for, do-while to iterate
4) Define and call functions to modularize code for swapping, factorial, Fibonacci series etc.
5) Use one-dimensional arrays to store and process data
This document discusses different types of functions in C programming. It explains that functions can be predefined standard library functions or user-defined functions. It provides examples of functions with no return type and no arguments, functions with no return type but arguments, and functions with a return type but no arguments. The syntax for defining, declaring, and calling functions is also demonstrated.
The document discusses inline functions in C++. It explains that inline functions are replaced by their function code during compilation so they run faster than regular functions but use more memory. It provides examples of declaring and defining inline functions and demonstrates how an inline function call is handled at runtime by replacing it with the function statements. The document also discusses making member functions inline within a class declaration.
An operator is a symbol designed to operate on data.
They can be a single symbol, di-graphs, tri-graphs or keywords.
Operators can be classified in different ways.
This is similar to function overloading
This document contains 24 C++ programs with explanations and sample outputs. The programs cover basic concepts like variable declaration and input/output, conditional statements, loops, functions, arrays and structures. The programs include calculating area and circumference of shapes, finding largest/smallest numbers, checking leap years, calculating electricity bills, compound interest, digit sum, palindrome checking and more. The programs are meant as examples for students to practice and learn C++ programming.
This presentation describes demerits of infix expressions for compiler, algorithm to convert given infix expression to postfix expression using stacks in Data Struictures along with several example solutions. It also contains program of stack ADT using <stack> STL.
This document discusses templates in C++. Templates allow functions and classes to work with multiple data types without writing separate code for each type. There are two types of templates: class templates, which define a family of classes that operate on different data types, and function templates, which define a family of functions that can accept different data types as arguments. Examples of each template type are provided to demonstrate how they can be used to create reusable and flexible code.
Chapter 4 : Balagurusamy Programming ANSI in CBUBT
The document contains solutions to programming problems from the book "C Programming: Chapter-4" by E. Balagurusamy. It includes problems on input/output operators like scanf() and printf(), reading and displaying data in various formats, rounding numbers, bar charts, multiplication tables, and formatting output. Each problem has the code snippet to solve it along with sample input/output. The solutions demonstrate proper use of scanf(), printf(), and formatting specifiers to handle different data types and formats.
The document provides an overview of references and pointers in C++. References act as aliases for objects without copying them, while pointers store the address of an object and require dereferencing. References must be initialized and cannot be changed or null, whereas pointers can be null and changed. Const references and pointers promise not to modify an object.
This document discusses pointers in C++. It defines pointers as variables that store memory addresses and can be used to access and manipulate data at those addresses. It explains how to declare and initialize pointers, including pointer to pointer declarations. It discusses using pointers as function arguments and dynamic memory allocation using pointers with the new and delete operators. Pointers allow referencing variables indirectly and allocating memory dynamically at runtime.
Two dimensional arrays in C can be declared and initialized similarly to one dimensional arrays, with the first subscript specifying the row and second subscript specifying the column. Elements are stored in contiguous memory locations in row-major order. The document then presents a sample problem of reading a 2D array of integers from a file, finding the largest element, and printing it out. It also discusses using typedef to define custom data types like matrices and strings.
Static Data Members and Member FunctionsMOHIT AGARWAL
Static data members and static member functions in C++ classes are shared by all objects of that class. Static data members are initialized to zero when the first object is created and shared across all instances, while static member functions can only access other static members and are called using the class name and scope resolution operator. The example program demonstrates a class with a static data member "count" that is incremented and accessed by multiple objects to assign increasing code values, and a static member function "showcount" that prints the shared count value.
CONSTRUCTOR AND DESTRUCTOR PPT BASED ON OOP SUBJECT ......FULLY CONCEPT EXPLAINED WITH SAMPLE PROGRAM IN IT .....FOR MORE SLIDES PLEASE FOLLOW ME ..... THANK YOU
This document provides an overview of string manipulation in C++. It discusses C-style strings and introduces C++ strings as objects of the string class. It describes various string constructors, functions for comparison, concatenation, insertion, extraction and other operations. Examples are given to demonstrate the use of functions like length(), capacity(), empty(), at(), find(), assign(), begin() and end(). The document is intended as a lecture on object-oriented string handling in C++.
This document contains instructions for several Java programming exercises involving classes, packages, inheritance, overriding, exceptions, and threads. It outlines code for programs that demonstrate concepts like classes and objects, command line arguments, bitwise operators, method overriding, and packages. For each exercise, it provides the aim, algorithm, sample code, input/output, and result to verify the output. The exercises are intended to help students learn and practice core Java programming concepts.
The document discusses key concepts related to functions in C programming including:
- Functions take input, perform operations, and return output. The main() function is required.
- Function prototypes declare a function's name, return type, and arguments before use.
- Function definitions specify the return type, name, arguments, and function body.
- Arguments are passed by value by default, but can be passed by reference using pointers.
- Recursive functions call themselves with different argument values until a base case is reached.
- Variables can have different scopes like global, file, local, and block depending on where they are declared. Static variables retain their value between function calls.
Here is a program to calculate the area of a ring using functions:
#include <iostream>
using namespace std;
// Function to calculate area of ring
double areaOfRing(double innerRadius, double outerRadius) {
return (M_PI * (outerRadius * outerRadius - innerRadius * innerRadius));
}
int main() {
double innerRadius, outerRadius;
// Get input from user
cout << "Enter inner radius of ring: ";
cin >> innerRadius;
cout << "Enter outer radius of ring: ";
cin >> outerRadius;
// Call function to calculate area
double area = areaOfRing(innerRadius, outerRadius);
//
This document contains 17 programming problems and their solutions involving object oriented programming concepts like classes, objects, functions, arrays, pointers etc. The problems cover basic concepts like calculating factorial, checking prime number, Fibonacci series, arithmetic operations using menus, finding largest element in array. More advanced concepts covered are bubble sort, selection sort, function overloading to calculate area of shapes, complex number addition using friend functions, student record management using classes. Overall, the document aims to provide practice on common OOP concepts through solving different programming problems.
The document contains 27 code examples that demonstrate various programming concepts in C++, including:
1. Printing numeric patterns using nested for loops.
2. Finding the largest number among 3 inputs using if/else statements and functions.
3. Calculating factorials, prime numbers, Fibonacci sequences and number tables using for loops.
4. Checking if a number is even/odd using if/else.
5. Illustrating the use of classes to store student data like roll numbers and marks in multiple subjects.
6. Defining functions both inside and outside classes to get/set data member values.
The code snippets cover basic programming constructs like loops, functions, classes,
This document contains solutions to 26 questions on C++ programming. It includes programs to display text using single and multiple cout statements, programs to check if a year is a leap year, solve quadratic equations, check if a number is even or odd, perform arithmetic operations using switch case, display the first 10 natural numbers and their sum, Fibonacci series, factorial of a number, check if a number is prime, find the sum of series, generate patterns with characters and numbers, find the sum and average of array elements, perform linear search on an array, and find the maximum number in an array. The document is prepared by Bijender Kumar and contains the question solutions and output for each program.
The document contains 26 C++ programs demonstrating basic programming concepts like variables, data types, input/output functions, conditional statements, loops, functions, arrays etc. The programs include calculations like addition, subtraction, cube, area of shapes, temperature conversion, tables, averages and patterns using for/while loops. Logical and relational operators as well as increment operators are also covered. The programs help learn and practice fundamental C++ programming.
The document discusses object oriented programming concepts in C++. It contains 4 questions with solutions. Question 1 defines a BankAccount class with data members like name, account number etc. and member functions to assign values, deposit, withdraw amounts. Question 2 overloads the increment operator ++. Question 3 overloads the > operator to find greater of two class instances. Question 4 demonstrates single and multiple inheritance - single inheritance defines a PhysicalFit class derived from BasicInfo class, multiple inheritance defines a DerivedD class derived from 3 base classes.
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 contains C++ code examples demonstrating various programming concepts like:
1. A program that takes input from the user, performs addition if the input letter is 'A' and prints output. Otherwise it prints invalid letter.
2. Multiple code snippets showing the use of for loops, if-else conditions, functions and arithmetic operations.
3. Code examples to find even/odd numbers in an array, check if a number is prime, calculate factorials, print multiplication tables and find the sum of numbers.
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.
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 contains code snippets that demonstrate differences between C and C++ and differences between C++98 and C++11 standards. It shows examples of printing output, taking user input, conditional statements, data types, auto keyword, and range-based for loops. The snippets are grouped with descriptions of the languages/standards they illustrate.
The document discusses if, if-else, and nested if statements in programming. It provides the syntax and examples of using each type of conditional statement to control program flow. It then provides 10 programming problems and their solutions that apply if/else logic to tasks like determining the youngest of three people, calculating phone bills based on call amounts, finding grades from marks, and other examples. The programs take user input, apply if/else conditional branching, and output the results.
The document discusses C++ programs involving classes and objects. It includes the definition of classes such as Applicant, Housing, Tour, Account and subclasses Current and Savings. The Applicant class stores applicant details and grades, Housing stores housing property data, Tour calculates tour fares, and Account is the base class for banking accounts with subclasses Current and Savings that inherit and expand its functionality. Member functions are defined to input, output and manipulate object data for these classes.
Create the equivalent of a four function calculator. The program should request the user to enter a number, an operator, and another number. carry out the specified arithmetical operation: adding, subtracting, multiplying, or dividing the two numbers. (Using switch statement ).ThesisScientist.com
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.
The document contains code snippets for several C++ programs including:
1) A program to calculate the product of two matrices by multiplying corresponding elements.
2) Functions to count the number of lines, words, and characters in a string.
3) A program with nested structures to store employee data including name, ID, and address.
4) A program to calculate student grades and results based on marks in 5 subjects.
The document provides code examples to generate different patterns using loops in C++. It includes code to:
1. Generate patterns like A B C D E F G, A B C E F G, A B F G, A G using nested for loops.
2. Generate patterns like 1, 1 2, 1 2 3 using nested for loops.
3. Generate patterns like *, * *, * * * using for loops and whitespace formatting.
4. Generate patterns like 1, 121, 1331, 14641 using pow() function.
It also includes code for a class to generate different patterns based on user input, code to display numbers in octal, decimal and hexadecimal format,
The document contains the certification for a student named UTTAMGUPTA who completed a research project under the guidance of their teacher Mr. Amit Dutta. It also includes thanks from the student to their teacher and family for their support and assistance. The remainder of the document lists 20 questions related to programming concepts and tasks for the student to complete as part of their project.
This document contains the code submissions for 7 programming assignments. Each submission contains C++ code to complete a task such as accepting user input, performing calculations, and outputting results. The tasks include: 1) Displaying the ASCII value of a character, 2) Accepting and outputting a name and age, 3) Separating digits of a 4-digit number, 4) Converting between Fahrenheit and Celsius temperatures, 5) Swapping variables with and without a third variable, and 6) Explaining sample code that assigns a character to an integer variable.
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".
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
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
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
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.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
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
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
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.
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
HCL Notes and Domino License Cost Reduction in the World of DLAU
Oops practical file
1. 100420825160 Ankit Dixit
1 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 1 : Write a program to check whether a given number is even or odd.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n;
cout<<"Enter number: ";
cin>>n;
if(n%2==0)
cout<<"Number is even";
else
cout<<"Number is odd";
getch();
}
2. 100420825160 Ankit Dixit
2 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 2: Write a program to find the greatest of three numbers using conditional
operator.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<"Enter a: ";
cin>>a;
cout<<"Enter b: ";
cin>>b;
cout<<"Enter c: ";
cin>>c;
if(a>b)
{
if(a>c)
cout<<"Largest is "<<a;
else
{
if (b>c)
cout<<"Largest is "<<b;
}}
else
cout<<"Largest is "<<c;
getch();
}
3. 100420825160 Ankit Dixit
3 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 3 : Write a program to find the sum of digits of a number.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,num,sum=0;
cout<<"n Enter the number: ";
cin>>n;
num=n;
while(num>0)
{
sum+=num%10;
num/=10;
}
cout<<"n The sum of digits of a number is "<<sum;
getch();
}
4. 100420825160 Ankit Dixit
4 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 4 : Write a program to generate Fibonacci series of first n numbers.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n;
int f1,f2,f3;
cout<<"Enter how many number series you need: ";
cin>>n;
f1=1;
f2=1;
cout<<f1<<endl;
cout<<f2<<endl;
int c=2;
while(c<n)
{
f3=f1+f2;
f1=f2;
f2=f3;
cout<<f3<<endl;
c++;
}
getch();
}
5. 100420825160 Ankit Dixit
5 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 5: Write a program to print the multiplication table of a given number.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,i;
cout<<"enter a no. for which you need a table";
cin>>n;
for(i=1;i<=10;i++)
cout<<n<<"*"<<i<<"="<<n*i<<endl;
getch();
}
6. 100420825160 Ankit Dixit
6 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 6 : Write a program to calculate the factorial of a number.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,num,fact=1;
cout<<"Enter the number: ";
cin>>num;
i=num;
while (num>0)
{
fact=fact*num;
--num;
}
cout<<"Factorial of "<<i<<" is "<<fact;
getch();
}
7. 100420825160 Ankit Dixit
7 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 7 : Write a program to add, subtract, multiply & division o two numbers
using switch statement.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
char opr;
cout<<"Enter any two numbers: ";
cin>>a>>b;
cout<<"Choose any operator(+,-,*,/): ";
cin>>opr;
switch(opr)
{
case'+':
int c=a+b;
cout<<"The addition of two numbers is: "<<c;
break;
case'-':
int d=a-b;
cout<<"The subtraction of two numbers is: "<<d;
break;
case'*':
int e=a*b;
cout<<"The multiplication of two numbers is: "<<e;
break;
case'/':
int f=a/b;
cout<<"The division of two numbers is: "<<f;
break;
default:
cout<<"Wrong operator";
}
getch();
}
9. 100420825160 Ankit Dixit
9 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 8 : Write a program to check whether a given number is prime or not.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int num,i,c=0;
cout<<"enter number: ";
cin>>num;
for(i=2;i<=num-1;i++)
{
if(num%i==0)
c++;
}
if(c!=0)
cout<<"it is not prime no.";
else
cout<<"it is prime no.";
getch();
}
10. 100420825160 Ankit Dixit
10 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 9 : Write a program to print the given pattern.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
for(int i=1;i<6;i++)
{
for(int j=6-i;j>=0;j--)
cout<<" ";
for(int k=i;k>=2;k--)
cout<<k;
for(int l=1;l<=i;l++)
cout<<l;
cout<<"n";
}
getch();
}
11. 100420825160 Ankit Dixit
11 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 10: Write a program to demonstrate the working of call by value.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y;
x=10;
y=20;
void swap(int,int);
swap(x,y);
cout<<"x= "<<x<<endl;
cout<<"y= "<<y;
getch();
}
void swap(int a, int b)
{
int t=a;
a=b;
b=t;
}
12. 100420825160 Ankit Dixit
12 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 11: Write a program to demonstrate the working of call by reference.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y;
x=10;
y=20;
void swap(int&, int&);
swap(x,y);
cout<<"x= "<<x<<endl;
cout<<"y= "<<y;
getch();
}
void swap(int &a, int &b)
{
int t=a;
a=b;
b=t;
}
13. 100420825160 Ankit Dixit
13 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 12: Write a program to demonstrate the working of pointers.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int *p;
int x;
cout<<"Enter a value: ";
cin>>x;
p=&x;
*p=*p+10;
cout<<"Now x is: "<<x<<endl;
cout<<"Value of x through p: "<<*p<<endl;
cout<<"The address of x is: "<<&x<<endl;
cout<<"The address of x is: "<<p<<endl;
getch();
}
14. 100420825160 Ankit Dixit
14 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 13: Write a program to demonstrate the use of inline functions.
#include<iostream.h>
#include<conio.h>
inline double cube(double x)
{
return(x*x*x);
}
void main()
{
clrscr();
double a;
cout<<"Enter a number: "
cin>>a;
cout<<"The cube of "<<a<<"is: "
cout<<cube(a);
getch();
}
15. 100420825160 Ankit Dixit
15 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 14: Write a program to demonstrate the working of default arguments.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int sum(int=30,int=30);
int a,b;
cout<<"Enter value of a: ";
cin>>a;
cout<<"Enter value of b: ";
cin>>b;
sum(a,b);
sum(a);
sum();
getch();
}
int sum(int x,int y)
{
int s=x+y;
cout<<"sum= "<<s<<endl;
return 0;
}
16. 100420825160 Ankit Dixit
16 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 15: Write a program to demonstrate the use of recursion.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int fact(int);
int f,n;
cout<<"Enter the number: ";
cin>>n;
f=fact(n);
cout<<"FACTORIAL= "<<f;
getch();
}
int fact(int n)
{
int value=1;
if(n==1)
return(value);
else
{
value=n*fact(n-1);
return(value);
}
getch();
}
17. 100420825160 Ankit Dixit
17 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 16: Write a program which reads two matrices and then print a matrix
which is addition of these two.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[3][3],b[3][3],s[3][3];
cout<<"Enter first matrix elements: "<<endl;
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
{
cin>>a[i][j];
}
cout<<"n Enter second matrix: "<<"nn";
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
cin>>b[i][j];
}
cout<<"n The first matrix is:"<<"nn";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<a[i][j];
cout<<"t";
}
cout<<endl;
}
cout<<"n The second matrix is:"<<"nn";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<b[i][j];
cout<<"t";
}
cout<<endl;
}
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
s[i][j] = a[i][j] + b[i][j];
}
18. 100420825160 Ankit Dixit
18 Submitted To: Ms. Achhardeep Kaur
cout<<"n The addition of two matrices is: "<<"nn";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<s[i][j]<<'t';
}
cout<<endl;
}
getch();
}
19. 100420825160 Ankit Dixit
19 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 17: Write a program to read a string and then copy that string into another.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char a[80],b[80];
void string_copy(char b[],char a[]);
cout<<"Enter a string: "<<endl;
cin.get(a,80);
string_copy (b,a);
cout<<"First string is: "<<endl;
cout<<a<<endl;
cout<<"Second string is: "<<endl;
cout<<b<<endl;
getch();
}
void string_copy (char b[],char a[])
{
int i,j;
i=0;
while(a[i]!='0')
{
b[i]=a[i];
i++;
}
b[i]='0';
}
20. 100420825160 Ankit Dixit
20 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 18: Write a program to demonstrate the working of structure within a
structure.
#include<iostream.h>
#include<conio.h>
struct date
{
int day;
char month_name[20];
int year;
};
struct biodata
{
char name[80];
date dob;
};
void main()
{clrscr();
biodata student;
cout<<"Enter name: "<<endl;
cin>>student.name;
cout<<"ENTER DATE OF BIRTH:"<<endl;
cout<<"Enter day: ";
cin>>student.dob.day;
cout<<"Enter month name: ";
cin>>student.dob.month_name;
cout<<"Enter year: ";
cin>>student.dob.year;
cout<<"The biodata is: "<<endl;
cout<<"Name: "<<student.name<<endl;
cout<<"Date of birth: ";
cout<<student.dob.day<<"-"<<student.dob.month_name<<"-";
cout<<student.dob.year<<endl;
getch();
}
22. 100420825160 Ankit Dixit
22 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 19: Write a program to calculate the area of rectangle using the concept of
object class.
#include<iostream.h>
#include<conio.h>
class area
{
public:
int l,b,area;
void getdata()
{
cout<<"Enter the length of the rectangle: ";
cin>>l;
cout<<"Enter the breadth of the rectangle: ";
cin>>b;
}
void display()
{
area=l*b;
cout<<"The area of rectangle is: "<<area;
}};
void main()
{
clrscr();
area s1;
s1.getdata();
s1.display();
getch();
}
23. 100420825160 Ankit Dixit
23 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 20 : Write a program to demonstrate data hiding, encapsulation and
abstraction.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
class date
{
public:
int day;
int month;
int year;
};
class date today;
today.day=12;
today.month=1;
today.year=1992;
cout<<"Today's date is "<<today.day<<"/";
cout<<today.month<<"/"<<today.year<<endl;
getch();
}
24. 100420825160 Ankit Dixit
24 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 21 : Write a program to show the working of static data members and static
member functions.
#include<iostream.h>
#include<conio.h>
class alpha
{
private:
static int x;
public:
alpha();
static void display()
{
cout<<"Content of x ";
cout<<"after incremented by one= "<<x<<endl;
}};
class beta
{
private:
int y;
public:
void getdata()
{
cout<<"Enter a value for y= n";
cin>>y;
}
void display()
{
cout<<"Content of y= "<<this->y<<endl;
}};
int alpha::x=10;
alpha::alpha()
{
++x;
}
void main()
{
clrscr();
alpha objx;
beta objy;
objy.getdata();
alpha::display();
objy.display();
getch();
}
26. 100420825160 Ankit Dixit
26 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 22 : Write a program to demonstrate the working of constructor.
#include<iostream.h>
#include<conio.h>
class sample
{
int a,b;
public:
sample()
{
cout<<"This is constructor. "<<endl;
a=100;
b=200;
}
int add()
{
return(a+b);
}};
void main()
{
clrscr();
sample s;
cout<<"Output is: "<<s.add()<<endl;
getch();
}
27. 100420825160 Ankit Dixit
27 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 23: Write a program to show the working of parameterized constructor.
#include<iostream.h>
#include<conio.h>
class student
{
int a,b;
public:
student(int a1,int b1)
{
a=a1;
b=b1;
}
int mul()
{
return(a*b);
}};
void main()
{
clrscr();
int i,j;
cout<<"Enter first number: ";
cin>>i;
cout<<"Enter second number: ";
cin>>j;
student c1(i,j);
cout<<"Multiplication is: ";
cout<<c1.mul()<<endl;
getch();
}
28. 100420825160 Ankit Dixit
28 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 24: Write a program to demonstrate constructor overloading.
#include<iostream.h>
#include<conio.h>
class complex
{
int x,y;
public:
complex(int a)
{
x=a;
y=a;
}
complex(int a,int b)
{
x=a;
y=b;
}
void add(complex c1,complex c2)
{
x=c1.x-c2.x;
y=c1.x-c2.y;
}
void show()
{
cout<<x<<"+i"<<y<<endl;
}};
void main()
{
clrscr();
complex a(3,5);
complex b(2);
complex c(0);
c.add(a,b);
a.show();
b.show();
cout<<"a-b is: ";
c.show();
getch();
}
39. 100420825160 Ankit Dixit
39 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 30: Write a program to demonstrate virtual functions.
#include<iostream.h>
#include<conio.h>
class b
{
public:
virtual void display()
{
cout<<"This is class b."<<endl;
}};
class d1:public b
{
public:
void display()
{
cout<<"This is class d1."<<endl;
}};
class d2:public b
{
public:
void display()
{
cout<<"This is class d2."<<endl;
}};
void main()
{
clrscr();
b*p;
d1 obj1;
d2 obj2;
b obj;
p=&obj;
p->display();
p=&obj1;
p->display();
p=&obj2;
p->display();
getch();
}
41. 100420825160 Ankit Dixit
41 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 31: Write a program to demonstrate friend function.
#include<iostream.h>
#include<conio.h>
class sample
{
int x;
int y;
public:
sample(int a,int b)
{
x=a;
y=b;
}
friend int add(sample s1);
};
int add(sample s1)
{
return(s1.x+s1.y);
}
void main()
{
clrscr();
sample s2(20,30);
int sum;
sum=add(s2);
cout<<"Sum of private data of object s2= ";
cout<<sum<<endl;
getch();
}
42. 100420825160 Ankit Dixit
42 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 32: Write a program to read multiple line string using get function.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char str[80];
cout<<"Enter multiple lines. "<<endl;
cout<<"Press enter after each line."<<endl;
cout<<"For terminating program,enter $.";
cout<<"and then press enter. "<<endl;
cin.get(str,80,'$');
cout<<"Entered multiple lines: "<<endl;
cout<<str<<endl;
getch();
}
43. 100420825160 Ankit Dixit
43 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 33: Write a program to demonstrate class template with constructor.
#include<iostream.h>
#include<conio.h>
template<class T>
class sample
{
private:T a,b;
public:sample (Ta1,Tb1)
{
a=a1;
b=b1;
}
T small()
{
if(a<b)
return(a);
else
return(b);
}};
void main()
{
sample<int>obj1(10,5);
cout<<"smaller no. is "<<obj1.small();
sample<float>obj2(10.5,20.5);
cout<<"smaller no. is "<<obj2.small();
getch();
}
44. 100420825160 Ankit Dixit
44 Submitted To: Ms. Achhardeep Kaur
PRACTICAL 34: Write a program to show function template with multiple parameters.
#include<iostream.h>
#include<conio.h>
template<class T1,class T2>
void show(T1a,T2b)
{
cout<<a<<"t"<<b<<endl;
}
void main()
{
clrscr();
show(1234,"kimmy");
show(5678,"rimmy");
show(9109,9019);
getch();
}