SlideShare ist ein Scribd-Unternehmen logo
1 von 3
The server where corresponding programs have been put is 10.203.161.7 under ~/CPP/
directory.

Session 1 - 2:
   1> Write a library class having public and private data members and functions. The
      class should allow basic operations like entering book details, displaying book
      details. Instantiate objects of this library class and perform operations on them.

   2> Write a Intgr class to imitate the behavior of an int object. Define add, subtract and
      multiply class members for this class. Instantiate objects of this class and perform
      addition, subtraction and multiplication operations on them.

   3> Implement a resource allocator using the concept of static data member and static
      member function. A Resource class should have a static data member to keep track
      of resource allocation (Boolean variable). Instances of this class will be allocated
      resource only if no other instance is holding the resource.



Session 3 - 4:

MEMORY OPERATIONS USING NEW DELETE

   1> Write a program to copy data from one int array to another. Use the concept of new
      and delete to allocate and deallocate memory for the arrays.


PASS BY REFERENCE

   1> Passing by reference is also an effective way to allow a function to return more than
      one value. Write a program that returns the previous and next numbers of the first
      parameter passed using the concept of pass by reference.


   2> Write a program to sort two numbers using call by reference. Smallest number
      should be output first.



CONSTRUCTOR & DESTRUCTOR - DYNAMIC MEMORY – COPY
CONSTRUCTOR
1> Write a box class with class members length, breadth, height and a function to
     calculate the volume of the box. Constructor should be passed arguments for length,
     breadth, height. Also define a second constructor which takes default height value
     of 10.


  2> Write a class with a “int *” member function whose constructor takes a int
     argument and allocates memory using “new” and destructor frees that memory.

  Note : Copy constructor should also be defined for this class.


  3> Write a class with a simple integer as class member and a member function that
     returns that value. There should be two overloaded constructors one which takes an
     integer as argument and the other taking a “char *” as argument.

  Note : Can use atoi function to convert “char *” to int.




Session 5 - 6 - 7:
  1> Write a base class with protected class members length and breadth. Derived class
     should have a function to calculate the area using length and breadth of base class.

  inheritance/inheritProtectedCalcArea.cpp


  2> Write a base and derived class with simple integer class members. Implement
     concept of base class constructor initialisation in the derived class constructor. Both
     the classes should have member function to display their class member values. This
     method should be protected in the base class and invoked from the base class.

  inheritance/inheritBaseMemInit.cpp

  3> Implement multiple and multi-level inheritance. Derived class derived should have
     protected and private inheritance from base classes base1 and base2, where base1
     and base2 have protected data members. Derived class derivedL2 should in turn
     publicly inherit from class derived. Try and access protected data members of
     base1 and base2 classes in derivedL2. Write destructor functions to see the
     sequence of destructor calls.

  inheritance/multiInherit.cpp
4> Implement concept of virtual function using base class named Window and derived class
      named CommandButton. Base class will have a virtual member function named Create
      which should be over ridden in derived class. In the main function, declare two base class
      pointers, one should invoke the base class Create function and the other should invoke
      derived class’s Create function.

  Inheritance/virtualGeneral.cpp

  5> Write a friend function for a class A to access it’s private data and compute addition on it’s
      private data. Similarly, write a friend class for this class A which accesses it’s private data
      and computes some subtraction on it’s data.

  Inheritance/friendFunction.cpp , friendClass.cpp




Session 8 -9 - 10:
  1> Write an overloaded volume function to calculate the volume of a cube
     (side*side*side), a cuboid (l*b*h) and a circle.

  2> Overload the ‘+’ operator to add two user defined objects.

  3> Define a person class with class members as name and age. Define a member
     function “greater” which takes one parameter (object of class person) as function
     argument. The function should compare the ages of two persons and return the
     object whose age is greater. Achieve the above using “this” pointer.

  4> Define a class shape with 2 data members to store length and height. Define
     member functions get_data() and display_area(). Display_area() should be virtual
     function. Define 2 derived classes from shape, triangle and rectangle which
     redefine display_area() for their own specific area calculation.

  5> Extend the above program to calculate are of a circle by introducing a new derived
     class called circle. The get_data() function in the shape class can be modified by
     taking default value for the second parameter.

Weitere Àhnliche Inhalte

Was ist angesagt?

High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14Matthieu Garrigues
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)Make Mannan
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL Rishabh-Rawat
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manualnikshaikh786
 
Computer science project work
Computer science project workComputer science project work
Computer science project workrahulchamp2345
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsProf. Dr. K. Adisesha
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++Pranav Ghildiyal
 
Brief Introduction to Cython
Brief Introduction to CythonBrief Introduction to Cython
Brief Introduction to CythonAleksandar Jelenak
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Sumant Tambe
 
Constructor in c++
Constructor in c++Constructor in c++
Constructor in c++Jay Patel
 
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORYCS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORYRadha Maruthiyan
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project  12th CBSE Computer Science Project
12th CBSE Computer Science Project Ashwin Francis
 
81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programs81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programsAbhishek Jena
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Saket Pathak
 
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programsharman kaur
 

Was ist angesagt? (20)

High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
 
Programs of C++
Programs of C++Programs of C++
Programs of C++
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manual
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++
 
Brief Introduction to Cython
Brief Introduction to CythonBrief Introduction to Cython
Brief Introduction to Cython
 
CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011CBSE Question Paper Computer Science with C++ 2011
CBSE Question Paper Computer Science with C++ 2011
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
 
Constructor in c++
Constructor in c++Constructor in c++
Constructor in c++
 
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORYCS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project  12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programs81818088 isc-class-xii-computer-science-project-java-programs
81818088 isc-class-xii-computer-science-project-java-programs
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)
 
I PUC CS Lab_programs
I PUC CS Lab_programsI PUC CS Lab_programs
I PUC CS Lab_programs
 
expression in cpp
expression in cppexpression in cpp
expression in cpp
 
Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programs
 
week-3x
week-3xweek-3x
week-3x
 

Andere mochten auch

C Languages FAQ's
C Languages FAQ'sC Languages FAQ's
C Languages FAQ'sSriram Raj
 
Binary Trees
Binary TreesBinary Trees
Binary TreesSriram Raj
 
Pointers In C
Pointers In CPointers In C
Pointers In CSriram Raj
 
Beej Guide Network Programming
Beej Guide Network ProgrammingBeej Guide Network Programming
Beej Guide Network ProgrammingSriram Raj
 
Pointers In C
Pointers In CPointers In C
Pointers In CSriram Raj
 

Andere mochten auch (6)

C Languages FAQ's
C Languages FAQ'sC Languages FAQ's
C Languages FAQ's
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
Pointers In C
Pointers In CPointers In C
Pointers In C
 
Rfc768
Rfc768Rfc768
Rfc768
 
Beej Guide Network Programming
Beej Guide Network ProgrammingBeej Guide Network Programming
Beej Guide Network Programming
 
Pointers In C
Pointers In CPointers In C
Pointers In C
 

Ähnlich wie Assignment Examples Final 07 Oct

Online CPP Homework Help
Online CPP Homework HelpOnline CPP Homework Help
Online CPP Homework HelpC++ Homework Help
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)rashmita_mishra
 
C++ Multiple Inheritance
C++ Multiple InheritanceC++ Multiple Inheritance
C++ Multiple Inheritanceharshaltambe
 
C questions
C questionsC questions
C questionsparm112
 
While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...bhargavi804095
 
Chapter 13 introduction to classes
Chapter 13 introduction to classesChapter 13 introduction to classes
Chapter 13 introduction to classesrsnyder3601
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And AnswerJagan Mohan Bishoyi
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 
Object oriented concepts & programming (2620003)
Object oriented concepts & programming (2620003)Object oriented concepts & programming (2620003)
Object oriented concepts & programming (2620003)nirajmandaliya
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answersAkash Gawali
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programmingnirajmandaliya
 
CS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2ndCS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2ndEdward Chen
 
Classes & objects new
Classes & objects newClasses & objects new
Classes & objects newlykado0dles
 
Ecet 370 Education Organization -- snaptutorial.com
Ecet 370   Education Organization -- snaptutorial.comEcet 370   Education Organization -- snaptutorial.com
Ecet 370 Education Organization -- snaptutorial.comDavisMurphyB81
 

Ähnlich wie Assignment Examples Final 07 Oct (20)

Online CPP Homework Help
Online CPP Homework HelpOnline CPP Homework Help
Online CPP Homework Help
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)
 
C++ Multiple Inheritance
C++ Multiple InheritanceC++ Multiple Inheritance
C++ Multiple Inheritance
 
C questions
C questionsC questions
C questions
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...
 
11-Classes.ppt
11-Classes.ppt11-Classes.ppt
11-Classes.ppt
 
Chapter 13 introduction to classes
Chapter 13 introduction to classesChapter 13 introduction to classes
Chapter 13 introduction to classes
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 
Object oriented concepts & programming (2620003)
Object oriented concepts & programming (2620003)Object oriented concepts & programming (2620003)
Object oriented concepts & programming (2620003)
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Class and object
Class and objectClass and object
Class and object
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 
CS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2ndCS225_Prelecture_Notes 2nd
CS225_Prelecture_Notes 2nd
 
Classes & objects new
Classes & objects newClasses & objects new
Classes & objects new
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Ecet 370 Education Organization -- snaptutorial.com
Ecet 370   Education Organization -- snaptutorial.comEcet 370   Education Organization -- snaptutorial.com
Ecet 370 Education Organization -- snaptutorial.com
 

Mehr von Sriram Raj

Interviewtcs
InterviewtcsInterviewtcs
InterviewtcsSriram Raj
 
Data Structures Aptitude
Data Structures AptitudeData Structures Aptitude
Data Structures AptitudeSriram Raj
 
Trees Information
Trees InformationTrees Information
Trees InformationSriram Raj
 
Html For Beginners 2
Html For Beginners 2Html For Beginners 2
Html For Beginners 2Sriram Raj
 
Cracking The Interview
Cracking The InterviewCracking The Interview
Cracking The InterviewSriram Raj
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data StructureSriram Raj
 
Html for Beginners
Html for BeginnersHtml for Beginners
Html for BeginnersSriram Raj
 
Hash Table
Hash TableHash Table
Hash TableSriram Raj
 
Deletion From A Bst
Deletion From A BstDeletion From A Bst
Deletion From A BstSriram Raj
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims AlgorithmSriram Raj
 
Linked List Problems
Linked List ProblemsLinked List Problems
Linked List ProblemsSriram Raj
 

Mehr von Sriram Raj (14)

Interviewtcs
InterviewtcsInterviewtcs
Interviewtcs
 
m tree
m treem tree
m tree
 
M tree
M treeM tree
M tree
 
Data Structures Aptitude
Data Structures AptitudeData Structures Aptitude
Data Structures Aptitude
 
Trees Information
Trees InformationTrees Information
Trees Information
 
Sctp
SctpSctp
Sctp
 
Html For Beginners 2
Html For Beginners 2Html For Beginners 2
Html For Beginners 2
 
Cracking The Interview
Cracking The InterviewCracking The Interview
Cracking The Interview
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Html for Beginners
Html for BeginnersHtml for Beginners
Html for Beginners
 
Hash Table
Hash TableHash Table
Hash Table
 
Deletion From A Bst
Deletion From A BstDeletion From A Bst
Deletion From A Bst
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims Algorithm
 
Linked List Problems
Linked List ProblemsLinked List Problems
Linked List Problems
 

KĂŒrzlich hochgeladen

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...gurkirankumar98700
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

KĂŒrzlich hochgeladen (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

Assignment Examples Final 07 Oct

  • 1. The server where corresponding programs have been put is 10.203.161.7 under ~/CPP/ directory. Session 1 - 2: 1> Write a library class having public and private data members and functions. The class should allow basic operations like entering book details, displaying book details. Instantiate objects of this library class and perform operations on them. 2> Write a Intgr class to imitate the behavior of an int object. Define add, subtract and multiply class members for this class. Instantiate objects of this class and perform addition, subtraction and multiplication operations on them. 3> Implement a resource allocator using the concept of static data member and static member function. A Resource class should have a static data member to keep track of resource allocation (Boolean variable). Instances of this class will be allocated resource only if no other instance is holding the resource. Session 3 - 4: MEMORY OPERATIONS USING NEW DELETE 1> Write a program to copy data from one int array to another. Use the concept of new and delete to allocate and deallocate memory for the arrays. PASS BY REFERENCE 1> Passing by reference is also an effective way to allow a function to return more than one value. Write a program that returns the previous and next numbers of the first parameter passed using the concept of pass by reference. 2> Write a program to sort two numbers using call by reference. Smallest number should be output first. CONSTRUCTOR & DESTRUCTOR - DYNAMIC MEMORY – COPY CONSTRUCTOR
  • 2. 1> Write a box class with class members length, breadth, height and a function to calculate the volume of the box. Constructor should be passed arguments for length, breadth, height. Also define a second constructor which takes default height value of 10. 2> Write a class with a “int *” member function whose constructor takes a int argument and allocates memory using “new” and destructor frees that memory. Note : Copy constructor should also be defined for this class. 3> Write a class with a simple integer as class member and a member function that returns that value. There should be two overloaded constructors one which takes an integer as argument and the other taking a “char *” as argument. Note : Can use atoi function to convert “char *” to int. Session 5 - 6 - 7: 1> Write a base class with protected class members length and breadth. Derived class should have a function to calculate the area using length and breadth of base class. inheritance/inheritProtectedCalcArea.cpp 2> Write a base and derived class with simple integer class members. Implement concept of base class constructor initialisation in the derived class constructor. Both the classes should have member function to display their class member values. This method should be protected in the base class and invoked from the base class. inheritance/inheritBaseMemInit.cpp 3> Implement multiple and multi-level inheritance. Derived class derived should have protected and private inheritance from base classes base1 and base2, where base1 and base2 have protected data members. Derived class derivedL2 should in turn publicly inherit from class derived. Try and access protected data members of base1 and base2 classes in derivedL2. Write destructor functions to see the sequence of destructor calls. inheritance/multiInherit.cpp
  • 3. 4> Implement concept of virtual function using base class named Window and derived class named CommandButton. Base class will have a virtual member function named Create which should be over ridden in derived class. In the main function, declare two base class pointers, one should invoke the base class Create function and the other should invoke derived class’s Create function. Inheritance/virtualGeneral.cpp 5> Write a friend function for a class A to access it’s private data and compute addition on it’s private data. Similarly, write a friend class for this class A which accesses it’s private data and computes some subtraction on it’s data. Inheritance/friendFunction.cpp , friendClass.cpp Session 8 -9 - 10: 1> Write an overloaded volume function to calculate the volume of a cube (side*side*side), a cuboid (l*b*h) and a circle. 2> Overload the ‘+’ operator to add two user defined objects. 3> Define a person class with class members as name and age. Define a member function “greater” which takes one parameter (object of class person) as function argument. The function should compare the ages of two persons and return the object whose age is greater. Achieve the above using “this” pointer. 4> Define a class shape with 2 data members to store length and height. Define member functions get_data() and display_area(). Display_area() should be virtual function. Define 2 derived classes from shape, triangle and rectangle which redefine display_area() for their own specific area calculation. 5> Extend the above program to calculate are of a circle by introducing a new derived class called circle. The get_data() function in the shape class can be modified by taking default value for the second parameter.