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.
Pratik Bakane C++ programs...............This are programs desingedby sy diploma student from Governement Polytecnic Thane.....programsare very easy alongwith coding andscreen shot of the output
This document contains 9 exercises demonstrating object-oriented programming concepts in C++ like classes, methods, constructors, and destructors. The exercises create classes to represent geometric shapes, birds, boxes, and more. Methods are defined to set and get data, calculate areas, and display output. Constructors and destructors are used to initialize and cleanup object memory.
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.
The document contains code snippets and descriptions for various C++ programs, including:
1) An abstract class example with Shape as the base class and Rectangle and Triangle as derived classes, demonstrating polymorphism.
2) A program that counts the words in a text by getting user input and parsing for whitespace.
3) An Armstrong number checker that determines if a number is an Armstrong number based on the sum of its digits.
4) Various other examples like binary search, complex number arithmetic, stacks, inheritance, and converting between Celsius and Fahrenheit temperatures.
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 discusses object oriented programming concepts in C++ like classes, objects, data members, member functions etc. It provides code examples to demonstrate defining classes with data members and member functions, creating objects of a class, accessing data members and calling member functions. It also shows the difference between declaring members as public or private. One example creates an Employee class with functions to get employee details like salary, working hours and calculate final salary. Another example creates an Employee class to store and print details of 3 employees like name, year of joining and address.
The document discusses pointers in C++. It defines a pointer as a special variable that stores the address of another variable of the same data type. It provides examples of declaring and accessing pointers, pointer arithmetic, pointers as function parameters and return types, pointers and arrays, pointers and strings, and pointers and structures. Key topics covered include pointer operators & and *, pointer arithmetic, self-referential structures, and an example of a linked list using pointers and nodes.
The document discusses pointers in C++. It defines a pointer as a special variable that stores the address of another variable of the same data type. It provides examples of declaring and accessing pointers, pointer arithmetic, pointers as function parameters and return types, pointers and arrays, pointers and strings, and pointers and structures. Key topics covered include pointer declaration and dereferencing operators, pointer arithmetic, self-referential structures, and using pointers to implement linked lists.
Can you finish and write the int main for the code according to the in.pdfaksachdevahosymills
Â
Can you finish and write the int main for the code according to the instruction Thank you so
much.
Here's the code for the BSTNode ADT and BST implementation:
#include <iostream>
#include <fstream>
#include <queue>
using namespace std;
// Krone class
class Krone {
private:
int wholeValue;
int fractionalValue;
public:
Krone() {}
Krone(int whole, int fraction) : wholeValue(whole), fractionalValue(fraction) {}
int getWhole() const { return wholeValue; }
int getFraction() const { return fractionalValue; }
bool operator<(const Krone& other) const {
if (wholeValue < other.wholeValue) {
return true;
} else if (wholeValue == other.wholeValue) {
return fractionalValue < other.fractionalValue;
} else {
return false;
}
}
friend ostream& operator<<(ostream& out, const Krone& krone) {
out << "Kr " << krone.wholeValue << "." << krone.fractionalValue;
return out;
}
};
// BST Node class
class BSTNode {
private:
Krone data;
BSTNode* left;
BSTNode* right;
public:
BSTNode() {}
BSTNode(const Krone& krone) : data(krone), left(nullptr), right(nullptr) {}
Krone getData() const { return data; }
BSTNode* getLeft() const { return left; }
BSTNode* getRight() const { return right; }
void setData(const Krone& krone) { data = krone; }
void setLeft(BSTNode* node) { left = node; }
void setRight(BSTNode* node) { right = node; }
};
// BST class
class BST {
private:
BSTNode* root;
public:
BST() : root(nullptr) {}
BSTNode* getRoot() const { return root; }
bool isEmpty() const { return root == nullptr; }
int countNodes(BSTNode* node) const {
if (node == nullptr) {
return 0;
} else {
return 1 + countNodes(node->getLeft()) + countNodes(node->getRight());
}
}
void empty(BSTNode* node) {
if (node != nullptr) {
empty(node->getLeft());
empty(node->getRight());
delete node;
}
}
void insertNode(const Krone& krone) {
BSTNode* node = new BSTNode(krone);
if (isEmpty()) {
root = node;
} else {
BSTNode* currNode = root;
while (true) {
if (krone < currNode->getData()) {
if (currNode->getLeft() == nullptr) {
currNode->setLeft(node);
break;
} else {
currNode = currNode->getLeft();
}
} else {
if (currNode->getRight() == nullptr) {
currNode->setRight(node);
break;
} else {
currNode = currNode->getRight();
}
}
}
}
}
BSTNode* searchNode(const Krone& krone) const {
BSTNode* currNode = root;
while (currNode != nullptr) {
Declare and implement a BSTNode ADT with a data attribute and two pointer attributes, one for
the left child and the other for the right child. Implement the usual getters/setters for these
attributes.
Declare and implement a BST as a link-based ADT whose data will be Krone objects - the data
will be inserted based on the actual money value of your Krone objects as a combination of the
whole value and fractional value attributes.
For the BST, implement the four traversal methods as well as methods for the usual search,
insert, delete, print, count, isEmpty, empty operations and any other needed.
Your pgm will use the following 20 Krone objects to be created in the exact order in your.
1. The document provides an introduction to object-oriented programming concepts and C++ programming.
2. It discusses the need for OOP over procedure-oriented programming and highlights the differences between the two approaches.
3. The document then covers basic C++ concepts like data types, functions, classes, inheritance and polymorphism through examples.
The document discusses polymorphism in C++. It shows how declaring functions as virtual in a base class and derived classes allows dynamic binding via pointers to the base class. When calling virtual functions through a base class pointer, the function called is determined by the actual object type, not the pointer type, allowing base class pointers to transparently access overridden functions in derived classes. This allows generic treatment of objects through their common base class.
The document provides an introduction to object-oriented programming (OOP) concepts in C++ including objects, classes, abstraction, encapsulation, inheritance, polymorphism, constructors, destructors, and exception handling. It defines each concept and provides examples of how it is implemented in C++ code. For instance, it explains that a class is a user-defined data type that holds its own data members and member functions, and provides an example class declaration. It also discusses polymorphism and provides examples demonstrating method overloading and overriding.
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 6 programs written in C++ demonstrating the use of classes and objects. Program 1 defines a Book class with private data members (page, price, title) and public member functions to get and display book details. Program 2 adds a setvalue function to modify object properties. Program 3 defines a Travel class to track distance and time with additional functions. Program 4 defines a Time class. Programs 5 and 6 demonstrate static class members and functions.
The Ring programming language version 1.7 book - Part 87 of 196Mahmoud Samir Fayed
Â
The document discusses embedding Ring language code in C/C++ programs using Ring API functions. It provides an example C program that initializes a Ring state, runs Ring code, and deletes the state. It also describes functions for creating/deleting Ring states, running code, and getting/setting variable values. Ring states allow running Ring code from C/C++ and accessing variables. The code generator tool is described for wrapping C/C++ libraries in Ring. Configuration files define functions to wrap, and options for customizing wrapper generation.
This document discusses virtual inheritance in C++. It defines classes for Animal, Horse, Bird, and Pegasus that inherit from each other virtually and non-virtually. The main function creates a Pegasus object and calls methods to demonstrate the inheritance and polymorphism.
This document contains code snippets from a student's practical work using Microsoft Visual Studio C++. It includes 15 code modules that demonstrate basics of C++ programming like input/output, data types, operators, conditional statements and functions. The modules progress from simple print statements to more complex concepts like nested if-else statements and switch cases. Each module is preceded by comments identifying the topic and module number.
This document contains the details of a programming project submitted by a student of class 12. It includes an acknowledgement section thanking the computer science teacher for guidance. It also includes a certificate signed by the teacher certifying that the student completed the project. The document then lists 23 programming problems/exercises addressed by the student with descriptions and signatures. It appears to be the final report submitted by the student for a programming assignment.
This document contains 3 solutions to C++ programming problems involving basic data types and classes.
Solution 1 defines a phone number struct and demonstrates initializing instances, getting user input, and outputting phone numbers. Solution 2 defines a point struct and shows adding the x and y coordinates of two points to find the sum. Solution 3 defines a Rectangle class with private width and length variables, and public methods to set/get dimensions and calculate perimeter and area, demonstrating default values and bounds checking.
SVD is a powerful matrix factorization technique used in machine learning, data science, and AI. It helps with dimensionality reduction, image compression, noise filtering, and more.
Mastering SVD can give you an edge in handling complex data efficiently!
Ad
More Related Content
Similar to Object Oriented Programming (OOP) using C++ - Lecture 3 (20)
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.
The document contains code snippets and descriptions for various C++ programs, including:
1) An abstract class example with Shape as the base class and Rectangle and Triangle as derived classes, demonstrating polymorphism.
2) A program that counts the words in a text by getting user input and parsing for whitespace.
3) An Armstrong number checker that determines if a number is an Armstrong number based on the sum of its digits.
4) Various other examples like binary search, complex number arithmetic, stacks, inheritance, and converting between Celsius and Fahrenheit temperatures.
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 discusses object oriented programming concepts in C++ like classes, objects, data members, member functions etc. It provides code examples to demonstrate defining classes with data members and member functions, creating objects of a class, accessing data members and calling member functions. It also shows the difference between declaring members as public or private. One example creates an Employee class with functions to get employee details like salary, working hours and calculate final salary. Another example creates an Employee class to store and print details of 3 employees like name, year of joining and address.
The document discusses pointers in C++. It defines a pointer as a special variable that stores the address of another variable of the same data type. It provides examples of declaring and accessing pointers, pointer arithmetic, pointers as function parameters and return types, pointers and arrays, pointers and strings, and pointers and structures. Key topics covered include pointer operators & and *, pointer arithmetic, self-referential structures, and an example of a linked list using pointers and nodes.
The document discusses pointers in C++. It defines a pointer as a special variable that stores the address of another variable of the same data type. It provides examples of declaring and accessing pointers, pointer arithmetic, pointers as function parameters and return types, pointers and arrays, pointers and strings, and pointers and structures. Key topics covered include pointer declaration and dereferencing operators, pointer arithmetic, self-referential structures, and using pointers to implement linked lists.
Can you finish and write the int main for the code according to the in.pdfaksachdevahosymills
Â
Can you finish and write the int main for the code according to the instruction Thank you so
much.
Here's the code for the BSTNode ADT and BST implementation:
#include <iostream>
#include <fstream>
#include <queue>
using namespace std;
// Krone class
class Krone {
private:
int wholeValue;
int fractionalValue;
public:
Krone() {}
Krone(int whole, int fraction) : wholeValue(whole), fractionalValue(fraction) {}
int getWhole() const { return wholeValue; }
int getFraction() const { return fractionalValue; }
bool operator<(const Krone& other) const {
if (wholeValue < other.wholeValue) {
return true;
} else if (wholeValue == other.wholeValue) {
return fractionalValue < other.fractionalValue;
} else {
return false;
}
}
friend ostream& operator<<(ostream& out, const Krone& krone) {
out << "Kr " << krone.wholeValue << "." << krone.fractionalValue;
return out;
}
};
// BST Node class
class BSTNode {
private:
Krone data;
BSTNode* left;
BSTNode* right;
public:
BSTNode() {}
BSTNode(const Krone& krone) : data(krone), left(nullptr), right(nullptr) {}
Krone getData() const { return data; }
BSTNode* getLeft() const { return left; }
BSTNode* getRight() const { return right; }
void setData(const Krone& krone) { data = krone; }
void setLeft(BSTNode* node) { left = node; }
void setRight(BSTNode* node) { right = node; }
};
// BST class
class BST {
private:
BSTNode* root;
public:
BST() : root(nullptr) {}
BSTNode* getRoot() const { return root; }
bool isEmpty() const { return root == nullptr; }
int countNodes(BSTNode* node) const {
if (node == nullptr) {
return 0;
} else {
return 1 + countNodes(node->getLeft()) + countNodes(node->getRight());
}
}
void empty(BSTNode* node) {
if (node != nullptr) {
empty(node->getLeft());
empty(node->getRight());
delete node;
}
}
void insertNode(const Krone& krone) {
BSTNode* node = new BSTNode(krone);
if (isEmpty()) {
root = node;
} else {
BSTNode* currNode = root;
while (true) {
if (krone < currNode->getData()) {
if (currNode->getLeft() == nullptr) {
currNode->setLeft(node);
break;
} else {
currNode = currNode->getLeft();
}
} else {
if (currNode->getRight() == nullptr) {
currNode->setRight(node);
break;
} else {
currNode = currNode->getRight();
}
}
}
}
}
BSTNode* searchNode(const Krone& krone) const {
BSTNode* currNode = root;
while (currNode != nullptr) {
Declare and implement a BSTNode ADT with a data attribute and two pointer attributes, one for
the left child and the other for the right child. Implement the usual getters/setters for these
attributes.
Declare and implement a BST as a link-based ADT whose data will be Krone objects - the data
will be inserted based on the actual money value of your Krone objects as a combination of the
whole value and fractional value attributes.
For the BST, implement the four traversal methods as well as methods for the usual search,
insert, delete, print, count, isEmpty, empty operations and any other needed.
Your pgm will use the following 20 Krone objects to be created in the exact order in your.
1. The document provides an introduction to object-oriented programming concepts and C++ programming.
2. It discusses the need for OOP over procedure-oriented programming and highlights the differences between the two approaches.
3. The document then covers basic C++ concepts like data types, functions, classes, inheritance and polymorphism through examples.
The document discusses polymorphism in C++. It shows how declaring functions as virtual in a base class and derived classes allows dynamic binding via pointers to the base class. When calling virtual functions through a base class pointer, the function called is determined by the actual object type, not the pointer type, allowing base class pointers to transparently access overridden functions in derived classes. This allows generic treatment of objects through their common base class.
The document provides an introduction to object-oriented programming (OOP) concepts in C++ including objects, classes, abstraction, encapsulation, inheritance, polymorphism, constructors, destructors, and exception handling. It defines each concept and provides examples of how it is implemented in C++ code. For instance, it explains that a class is a user-defined data type that holds its own data members and member functions, and provides an example class declaration. It also discusses polymorphism and provides examples demonstrating method overloading and overriding.
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 6 programs written in C++ demonstrating the use of classes and objects. Program 1 defines a Book class with private data members (page, price, title) and public member functions to get and display book details. Program 2 adds a setvalue function to modify object properties. Program 3 defines a Travel class to track distance and time with additional functions. Program 4 defines a Time class. Programs 5 and 6 demonstrate static class members and functions.
The Ring programming language version 1.7 book - Part 87 of 196Mahmoud Samir Fayed
Â
The document discusses embedding Ring language code in C/C++ programs using Ring API functions. It provides an example C program that initializes a Ring state, runs Ring code, and deletes the state. It also describes functions for creating/deleting Ring states, running code, and getting/setting variable values. Ring states allow running Ring code from C/C++ and accessing variables. The code generator tool is described for wrapping C/C++ libraries in Ring. Configuration files define functions to wrap, and options for customizing wrapper generation.
This document discusses virtual inheritance in C++. It defines classes for Animal, Horse, Bird, and Pegasus that inherit from each other virtually and non-virtually. The main function creates a Pegasus object and calls methods to demonstrate the inheritance and polymorphism.
This document contains code snippets from a student's practical work using Microsoft Visual Studio C++. It includes 15 code modules that demonstrate basics of C++ programming like input/output, data types, operators, conditional statements and functions. The modules progress from simple print statements to more complex concepts like nested if-else statements and switch cases. Each module is preceded by comments identifying the topic and module number.
This document contains the details of a programming project submitted by a student of class 12. It includes an acknowledgement section thanking the computer science teacher for guidance. It also includes a certificate signed by the teacher certifying that the student completed the project. The document then lists 23 programming problems/exercises addressed by the student with descriptions and signatures. It appears to be the final report submitted by the student for a programming assignment.
This document contains 3 solutions to C++ programming problems involving basic data types and classes.
Solution 1 defines a phone number struct and demonstrates initializing instances, getting user input, and outputting phone numbers. Solution 2 defines a point struct and shows adding the x and y coordinates of two points to find the sum. Solution 3 defines a Rectangle class with private width and length variables, and public methods to set/get dimensions and calculate perimeter and area, demonstrating default values and bounds checking.
SVD is a powerful matrix factorization technique used in machine learning, data science, and AI. It helps with dimensionality reduction, image compression, noise filtering, and more.
Mastering SVD can give you an edge in handling complex data efficiently!
Download YouTube By Click 2025 Free Full Activatedsaniamalik72555
Â
Copy & Past Link 👉👉
https://dr-up-community.info/
"YouTube by Click" likely refers to the ByClick Downloader software, a video downloading and conversion tool, specifically designed to download content from YouTube and other video platforms. It allows users to download YouTube videos for offline viewing and to convert them to different formats.
Exploring Wayland: A Modern Display Server for the FutureICS
Â
Wayland is revolutionizing the way we interact with graphical interfaces, offering a modern alternative to the X Window System. In this webinar, we’ll delve into the architecture and benefits of Wayland, including its streamlined design, enhanced performance, and improved security features.
AgentExchange is Salesforce’s latest innovation, expanding upon the foundation of AppExchange by offering a centralized marketplace for AI-powered digital labor. Designed for Agentblazers, developers, and Salesforce admins, this platform enables the rapid development and deployment of AI agents across industries.
Email: [email protected]
Phone: +1(630) 349 2411
Website: https://www.fexle.com/blogs/agentexchange-an-ultimate-guide-for-salesforce-consultants-businesses/?utm_source=slideshare&utm_medium=pptNg
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Andre Hora
Â
Exceptions allow developers to handle error cases expected to occur infrequently. Ideally, good test suites should test both normal and exceptional behaviors to catch more bugs and avoid regressions. While current research analyzes exceptions that propagate to tests, it does not explore other exceptions that do not reach the tests. In this paper, we provide an empirical study to explore how frequently exceptional behaviors are tested in real-world systems. We consider both exceptions that propagate to tests and the ones that do not reach the tests. For this purpose, we run an instrumented version of test suites, monitor their execution, and collect information about the exceptions raised at runtime. We analyze the test suites of 25 Python systems, covering 5,372 executed methods, 17.9M calls, and 1.4M raised exceptions. We find that 21.4% of the executed methods do raise exceptions at runtime. In methods that raise exceptions, on the median, 1 in 10 calls exercise exceptional behaviors. Close to 80% of the methods that raise exceptions do so infrequently, but about 20% raise exceptions more frequently. Finally, we provide implications for researchers and practitioners. We suggest developing novel tools to support exercising exceptional behaviors and refactoring expensive try/except blocks. We also call attention to the fact that exception-raising behaviors are not necessarily “abnormal” or rare.
Societal challenges of AI: biases, multilinguism and sustainabilityJordi Cabot
Â
Towards a fairer, inclusive and sustainable AI that works for everybody.
Reviewing the state of the art on these challenges and what we're doing at LIST to test current LLMs and help you select the one that works best for you
Creating Automated Tests with AI - Cory House - Applitools.pdfApplitools
Â
In this fast-paced, example-driven session, Cory House shows how today’s AI tools make it easier than ever to create comprehensive automated tests. Full recording at https://applitools.info/5wv
See practical workflows using GitHub Copilot, ChatGPT, and Applitools Autonomous to generate and iterate on tests—even without a formal requirements doc.
DVDFab Crack FREE Download Latest Version 2025younisnoman75
Â
â•️➡️ FOR DOWNLOAD LINK : http://drfiles.net/ ⬅️â•️
DVDFab is a multimedia software suite primarily focused on DVD and Blu-ray disc processing. It offers tools for copying, ripping, creating, and editing DVDs and Blu-rays, as well as features for downloading videos from streaming sites. It also provides solutions for playing locally stored video files and converting audio and video formats.
Here's a more detailed look at DVDFab's offerings:
DVD Copy:
DVDFab offers software for copying and cloning DVDs, including removing copy protections and creating backups.
DVD Ripping:
This allows users to rip DVDs to various video and audio formats for playback on different devices, while maintaining the original quality.
Blu-ray Copy:
DVDFab provides tools for copying and cloning Blu-ray discs, including removing Cinavia protection and creating lossless backups.
4K UHD Copy:
DVDFab is known for its 4K Ultra HD Blu-ray copy software, allowing users to copy these discs to regular BD-50/25 discs or save them as 1:1 lossless ISO files.
DVD Creator:
This tool allows users to create DVDs from various video and audio formats, with features like GPU acceleration for faster burning.
Video Editing:
DVDFab includes a video editing tool for tasks like cropping, trimming, adding watermarks, external subtitles, and adjusting brightness.
Video Player:
A free video player that supports a wide range of video and audio formats.
All-In-One:
DVDFab offers a bundled software package, DVDFab All-In-One, that includes various tools for handling DVD and Blu-ray processing.
How can one start with crypto wallet development.pptxlaravinson24
Â
This presentation is a beginner-friendly guide to developing a crypto wallet from scratch. It covers essential concepts such as wallet types, blockchain integration, key management, and security best practices. Ideal for developers and tech enthusiasts looking to enter the world of Web3 and decentralized finance.
Who Watches the Watchmen (SciFiDevCon 2025)Allon Mureinik
Â
Tests, especially unit tests, are the developers’ superheroes. They allow us to mess around with our code and keep us safe.
We often trust them with the safety of our codebase, but how do we know that we should? How do we know that this trust is well-deserved?
Enter mutation testing – by intentionally injecting harmful mutations into our code and seeing if they are caught by the tests, we can evaluate the quality of the safety net they provide. By watching the watchmen, we can make sure our tests really protect us, and we aren’t just green-washing our IDEs to a false sense of security.
Talk from SciFiDevCon 2025
https://www.scifidevcon.com/courses/2025-scifidevcon/contents/680efa43ae4f5
Join Ajay Sarpal and Miray Vu to learn about key Marketo Engage enhancements. Discover improved in-app Salesforce CRM connector statistics for easy monitoring of sync health and throughput. Explore new Salesforce CRM Synch Dashboards providing up-to-date insights into weekly activity usage, thresholds, and limits with drill-down capabilities. Learn about proactive notifications for both Salesforce CRM sync and product usage overages. Get an update on improved Salesforce CRM synch scale and reliability coming in Q2 2025.
Key Takeaways:
Improved Salesforce CRM User Experience: Learn how self-service visibility enhances satisfaction.
Utilize Salesforce CRM Synch Dashboards: Explore real-time weekly activity data.
Monitor Performance Against Limits: See threshold limits for each product level.
Get Usage Over-Limit Alerts: Receive notifications for exceeding thresholds.
Learn About Improved Salesforce CRM Scale: Understand upcoming cloud-based incremental sync.
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfTechSoup
Â
In this webinar we will dive into the essentials of generative AI, address key AI concerns, and demonstrate how nonprofits can benefit from using Microsoft’s AI assistant, Copilot, to achieve their goals.
This event series to help nonprofits obtain Copilot skills is made possible by generous support from Microsoft.
What You’ll Learn in Part 2:
Explore real-world nonprofit use cases and success stories.
Participate in live demonstrations and a hands-on activity to see how you can use Microsoft 365 Copilot in your own work!
Not So Common Memory Leaks in Java WebinarTier1 app
Â
This SlideShare presentation is from our May webinar, “Not So Common Memory Leaks & How to Fix Them?”, where we explored lesser-known memory leak patterns in Java applications. Unlike typical leaks, subtle issues such as thread local misuse, inner class references, uncached collections, and misbehaving frameworks often go undetected and gradually degrade performance. This deck provides in-depth insights into identifying these hidden leaks using advanced heap analysis and profiling techniques, along with real-world case studies and practical solutions. Ideal for developers and performance engineers aiming to deepen their understanding of Java memory management and improve application stability.
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Ranjan Baisak
Â
As software complexity grows, traditional static analysis tools struggle to detect vulnerabilities with both precision and context—often triggering high false positive rates and developer fatigue. This article explores how Graph Neural Networks (GNNs), when applied to source code representations like Abstract Syntax Trees (ASTs), Control Flow Graphs (CFGs), and Data Flow Graphs (DFGs), can revolutionize vulnerability detection. We break down how GNNs model code semantics more effectively than flat token sequences, and how techniques like attention mechanisms, hybrid graph construction, and feedback loops significantly reduce false positives. With insights from real-world datasets and recent research, this guide shows how to build more reliable, proactive, and interpretable vulnerability detection systems using GNNs.
4. #include <iostream>
#include <string>
using namespace std;
class Car {
private:
string make;
double price;
int year;
public:
Car() : make(""), price(0.0), year(0)
{ }
Car(string carMake, double carPrice, int carYear)
{
make = carMake;
price = carPrice;
year = carYear;
}
void setDetails() {
cout << "Enter car make: ";
getline(cin, make);
cout << "Enter car price: ";
cin >> price;
cout << "Enter production year: ";
cin >> year;
}
void displayDetails() const {
cout << "Car Make (Company): " << make << endl;
cout << "Car Price: " << price << endl;
cout << "Car Year: " << year << endl;
}
};
int main() {
Car myCar;
// Get car details
myCar.setDetails();
// Show the car details
cout << "Car Details:n";
myCar.displayDetails();
return 0;
}
Example
Car Class
6. Inheritance in OOP
– Inheritance is probably the most powerful feature of object-oriented
programming, after classes themselves.
– Inheritance is the process of creating new classes, called derived classes, from
existing or base classes.
– The derived class inherits all the capabilities of the base class but can add
embellishments and refinements of its own.
– The main class remain unchanged.
– Inheritance allows code reusability.
8. #include <iostream>
using namespace std;
class Counter //base class
{
protected: //NOTE: not private
unsigned int count; //count
public:
Counter() : count(0) //no-arg constructor
{ }
Counter(int c) : count(c) //1-arg constructor
{ }
unsigned int get_count() const //return count
{
return count;
}
Counter operator ++ () //incr count (prefix)
{
return Counter(++count);
}
};
class CountDn : public Counter //derived class
{
public:
Counter operator -- () //decr count (prefix)
{
return Counter(--count);
}
};
int main()
{
CountDn c1; //c1 of class CountDn
cout << "c1 = " << c1.get_count() << endl; //display c1
++c1;
++c1;
++c1;
cout << "c1 = " << c1.get_count() << endl; //display it
--c1;
--c1;
cout << "c1 = " << c1.get_count() << endl; //display it
return 0;
}
Example
9. #include <iostream>
using namespace std;
// Base (Super) Class
class Shape
{
private:
int height;
int width;
public:
Shape() : height(0), width(0)
{ }
Shape(int h, int w) : height(h), width(w)
{ }
int getHeight() const {
return height;
}
int getWidth() const {
return width;
}
void printData() const {
cout << "Height: " << height << endl;
cout << "Width: " << width << endl;
}
};
// Dervied (Sub) Class
class Square : public Shape
{
public:
Square() : Shape()
{ }
Square(int s) : Shape(s, s)
{ }
int getArea() const {
return getHeight() * getWidth();
}
};
// Dervied (Sub) Class
class Rectangle : public Shape
{
public:
Rectangle() : Shape()
{ }
Rectangle(int h, int w) : Shape(h, w)
{ }
int getArea() const {
return getHeight() * getWidth();
}
};
int main()
{
Square s1(5);
Rectangle r1(7, 2);
cout << "Square Area: " << s1.getArea() << endl;
cout << "Rectangle Area: " << r1.getArea() << endl;
return 0;
}
Example
10. The protected Access Specifier
– A protected member can be accessed by member functions in its own
class or in any class derived from its own class.
– It can’t be accessed from functions outside these classes, such as main().
11. #include <iostream>
using namespace std;
class Counter
{
protected: //NOTE: not private
unsigned int count; //count
public:
Counter() : count(0) //constructor, no args
{ }
Counter(int c) : count(c) //constructor, one arg
{ }
unsigned int get_count() const //return count
{
return count;
}
Counter operator ++ () //incr count (prefix)
{
return Counter(++count);
}
};
class CountDn : public Counter
{
public:
CountDn() : Counter() //constructor, no args
{ }
CountDn(int c) : Counter(c) //constructor, 1 arg
{ }
CountDn operator -- () //decr count (prefix)
{
return CountDn(--count);
}
};
int main()
{
CountDn c1; //class CountDn
CountDn c2(100);
cout << "c1 = " << c1.get_count() << endl; //display
cout << "c2 = " << c2.get_count() << endl; //display
++c1; ++c1; ++c1; //increment c1
cout << "c1 = " << c1.get_count() << endl; //display it
--c2; --c2; //decrement c2
cout << "c2 = " << c2.get_count() << endl; //display it
CountDn c3 = --c2; //create c3 from c2
cout << "c3 = " << c3.get_count() << endl; //display c3
return 0;
}
Derived Class
Constructors
The CountDn() constructor calls
the Counter() constructor in the
base class.
12. #include <iostream>
#include <process.h> //for exit()
using namespace std;
class Stack
{
protected: //NOTE: can’t be private
enum { MAX = 3 }; //size of stack array
int st[MAX]; //stack: array of integers
int top; //index to top of stack
public:
Stack() : top(-1) //constructor
{ }
void push(int var) //put number on stack
{
st[++top] = var;
}
int pop() //take number off stack
{
return st[top--];
}
};
class Stack2 : public Stack
{
public:
void push(int var) //put number on stack
{
if (top >= MAX - 1) //error if stack full
{
cout << "nError: stack is full";
exit(1);
}
Stack::push(var); //call push() in Stack class
}
int pop() //take number off stack
{
if (top < 0) //error if stack empty
{
cout << "nError: stack is emptyn";
exit(1);
}
return Stack::pop(); //call pop() in Stack class
}
};
int main()
{
Stack2 s1;
s1.push(11); //push some values onto stack
s1.push(22);
s1.push(33);
cout << endl << s1.pop(); //pop some values from stack
cout << endl << s1.pop();
cout << endl << s1.pop();
cout << endl << s1.pop(); //oops, popped one too many...
return 0;
}
Overriding Member
Functions
13. #include <iostream>
using namespace std;
enum posneg { pos, neg }; //for sign in DistSign
class Distance
{
protected: //NOTE: can't be private
int feet;
float inches;
public:
Distance() : feet(0), inches(0.0)
{ }
Distance(int ft, float in) : feet(ft), inches(in)
{ }
void getdist() {
cout << "nEnter feet: "; cin >> feet;
cout << "Enter inches: "; cin >> inches;
}
void showdist() const {
cout << feet << "' - " << inches << '"';
}
};
class DistSign : public Distance //adds sign to Distance
{
private:
posneg sign; //sign is pos or neg
public:
DistSign() : Distance() //call base constructor
{
sign = pos; //set the sign to +
}
// 2- or 3-arg constructor
DistSign(int ft, float in, posneg sg = pos) : Distance(ft, in) //call base constructor
{
sign = sg; //set the sign
}
void getdist() //get length from user
{
Distance::getdist(); //call base getdist()
char ch; //get sign from user
cout << "Enter sign (+ or -): ";
cin >> ch;
sign = (ch == '+') ? pos : neg;
}
void showdist() const //display distance
{
cout << ((sign == pos) ? "(+)" : "(-)"); //show sign
Distance::showdist(); //ft and in
}
};
int main()
{
DistSign alpha; //no-arg constructor
alpha.getdist(); //get alpha from user
DistSign beta(11, 6.25); //2-arg constructor
DistSign gamma(100, 5.5, neg); //3-arg constructor
//display all distances
cout << "nalpha = ";
alpha.showdist();
cout << "nbeta = ";
beta.showdist();
cout << "ngamma = ";
gamma.showdist();
return 0;
}
Derived Class
Constructors
More Complex Example
16. #include <iostream>
using namespace std;
const int LEN = 80; //maximum length of names
class employee //employee class
{
private:
char name[LEN]; //employee name
unsigned long number; //employee number
public:
void getdata()
{
cout << "n Enter last name: "; cin >> name;
cout << " Enter number: "; cin >> number;
}
void putdata() const
{
cout << "n Name: " << name;
cout << "n Number: " << number;
}
};
class manager : public employee //management class
{
private:
char title[LEN]; //"vice-president" etc.
double dues; //golf club dues
public:
void getdata()
{
employee::getdata();
cout << " Enter title: "; cin >> title;
cout << " Enter golf club dues: "; cin >> dues;
}
void putdata() const
{
employee::putdata();
cout << "n Title: " << title;
cout << "n Golf club dues: " << dues;
}
};
class scientist : public employee //scientist class
{
private:
int pubs; //number of publications
public:
void getdata()
{
employee::getdata();
cout << " Enter number of pubs: "; cin >> pubs;
}
void putdata() const
{
employee::putdata();
cout << "n Number of publications: " << pubs;
}
};
class laborer : public employee //laborer class
{
};
int main()
{
manager m1;
scientist s1;
laborer l1;
//get data for several employees
cout << "nEnter data for manager 1";
m1.getdata();
cout << "nEnter data for scientist 1";
s1.getdata();
cout << "nEnter data for laborer 1";
l1.getdata();
//display data for several employees
cout << "nData on manager 1";
m1.putdata();
cout << "nData on scientist 1";
s1.putdata();
cout << "nData on laborer 1";
l1.putdata();
return 0;
}
Example
Class Hierarchies
18. #include <iostream>
using namespace std;
class A //base class
{
private:
int privdataA;
protected:
int protdataA;
public:
int pubdataA;
};
class B : public A //publicly-derived class
{
public:
void funct()
{
int a;
a = privdataA; //error: not accessible
a = protdataA; //OK
a = pubdataA; //OK
}
};
class C : private A //privately-derived class
{
public:
void funct()
{
int a;
a = privdataA; //error: not accessible
a = protdataA; //OK
a = pubdataA; //OK
}
};
int main()
{
int a;
B objB;
a = objB.privdataA; //error: not accessible
a = objB.protdataA; //error: not accessible
a = objB.pubdataA; //OK (A public to B)
C objC;
a = objC.privdataA; //error: not accessible
a = objC.protdataA; //error: not accessible
a = objC.pubdataA; //error: not accessible (A private to C)
return 0;
}
publicly- and privately-
derived classes
21. Multiple Inheritance
UML Class Diagram
class A // base class A
{ };
class B // base class B
{ };
class C : public A, public B // C is
derived from A and B
{ };
22. #include <iostream>
using namespace std;
const int LEN = 80; //maximum length of names
class student //educational background
{
private:
char school[LEN]; //name of school or university
char degree[LEN]; //highest degree earned
public:
void getedu()
{
cout << " Enter name of school or university: ";
cin >> school;
cout << " Enter highest degree earned (Highschool, Bachelor’s, Master’s, PhD): ";
cin >> degree;
}
void putedu() const
{
cout << "n School or university: " << school;
cout << "n Highest degree earned: " << degree;
}
};
class employee
{
private:
char name[LEN]; //employee name
unsigned long number; //employee number
public:
void getdata()
{
cout << "n Enter last name: "; cin >> name;
cout << " Enter number: "; cin >> number;
}
void putdata() const
{
cout << "n Name: " << name;
cout << "n Number: " << number;
}
};
class manager : private employee, private student //management
{
private:
char title[LEN]; //"vice-president" etc.
double dues; //golf club dues
public:
void getdata()
{
employee::getdata();
cout << " Enter title: "; cin >> title;
cout << " Enter golf club dues: "; cin >> dues;
student::getedu();
}
void putdata() const
{
employee::putdata();
cout << "n Title: " << title;
cout << "n Golf club dues: " << dues;
student::putedu();
}
};
class scientist : private employee, private student //scientist
{
private:
int pubs; //number of publications
public:
void getdata()
{
employee::getdata();
cout << " Enter number of pubs: "; cin >> pubs;
student::getedu();
}
void putdata() const
{
employee::putdata();
cout << "n Number of publications: " << pubs;
student::putedu();
}
};
class laborer : public employee //laborer
{ };
int main()
{
manager m1;
scientist s1;
laborer l1;
//get data for several employees
cout << "nEnter data for manager 1";
m1.getdata();
cout << "nEnter data for scientist 1";
s1.getdata();
cout << "nEnter data for laborer 1";
l1.getdata();
//display data for several employees
cout << "nData on manager 1";
m1.putdata();
cout << "nData on scientist 1";
s1.putdata();
cout << "nData on laborer 1";
l1.putdata();
return 0;
}
Example
23. private Derivation
– The manager and scientist classes in EMPMULT are privately derived from the
employee and student classes.
– There is no need to use public derivation because objects of manager and
scientist never call routines in the employee and student base classes.
– However, the laborer class must be publicly derived from employer, since it
has no member functions of its own and relies on those in employee.
25. #include <iostream>
using namespace std;
class A {
public:
void show() { cout << "Class An"; }
};
class B {
public:
void show() { cout << "Class Bn"; }
};
class C : public A, public B
{};
int main() {
C objC; //object of class C
// objC.show(); //ambiguous--will not compile
objC.A::show(); //OK
objC.B::show(); //OK
return 0;
}
Ambiguity in Multiple
Inheritance
1) Two base classes have functions
with the same name, while a class
derived from both base classes
has no function with this name.
How do objects of the derived
class access the correct base class
function?
26. #include <iostream>
using namespace std;
class A {
public:
void func();
};
class B : public A
{ };
class C : public A
{ };
class D : public B, public C
{ };
int main()
{
D objD;
objD.func(); //ambiguous: won’t compile
return 0;
}
Ambiguity in Multiple
Inheritance
2) Another kind of ambiguity arises
if you derive a class from two
classes that are each derived
from the same class.
This creates a diamond-shaped
inheritance tree.
27. #include <iostream>
#include <string>
using namespace std;
class student //educational background
{
private:
string school; //name of school or university
string degree; //highest degree earned
public:
void getedu()
{
cout << " Enter name of school or university: ";
cin >> school;
cout << " Enter highest degree earned (Highschool, Bachelor’s, Master’s, PhD): ";
cin >> degree;
}
void putedu() const
{
cout << "n School or university: " << school;
cout << "n Highest degree earned: " << degree;
}
};
class employee
{
private:
string name; //employee name
unsigned long number; //employee number
public:
void getdata()
{
cout << "n Enter last name: "; cin >> name;
cout << " Enter number: "; cin >> number;
}
void putdata() const
{
cout << "n Name: " << name;
cout << "n Number: " << number;
}
};
class manager //management
{
private:
string title; //"vice-president" etc.
double dues; //golf club dues
employee emp; //** object of class employee
student stu; //** object of class student
public:
void getdata()
{
emp.getdata();
cout << " Enter title: "; cin >> title;
cout << " Enter golf club dues: "; cin >> dues;
stu.getedu();
}
void putdata() const
{
emp.putdata();
cout << "n Title: " << title;
cout << "n Golf club dues: " << dues;
stu.putedu();
}
};
class scientist //scientist
{
private:
int pubs; //number of publications
employee emp; //** object of class employee
student stu; //** object of class student
public:
void getdata()
{
emp.getdata();
cout << " Enter number of pubs: "; cin >> pubs;
stu.getedu();
}
void putdata() const
{
emp.putdata();
cout << "n Number of publications: " << pubs;
stu.putedu();
}
};
class laborer //laborer
{
private:
employee emp; //object of class employee
public:
void getdata() {
emp.getdata();
}
void putdata() const {
emp.putdata();
}
};
int main()
{
manager m1;
scientist s1;
laborer l1;
//get data for several employees
cout << "nEnter data for manager 1";
m1.getdata();
cout << "nEnter data for scientist 1";
s1.getdata();
cout << "nEnter data for laborer 1";
l1.getdata();
//display data for several employees
cout << "nData on manager 1";
m1.putdata();
cout << "nData on scientist 1";
s1.putdata();
cout << "nData on laborer 1";
l1.putdata();
return 0;
}
Aggregation instead of
inheritance
2) Another kind of ambiguity arises
if you derive a class from two
classes that are each derived
from the same class.
This creates a diamond-shaped
inheritance tree.