Classes & objects new

Classes & Objects Ms. Ma. Patricia B. Lina
What is a class? ,[object Object]
What is an object? ,[object Object]
Class vs. Object Vehicle Car Animal Elephant Person Student Flower Rose
How to declare a class? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Class vs. Struct ,[object Object]
What is an access specifier? ,[object Object],[object Object],[object Object],[object Object]
[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to access members of a class? ,[object Object],[object Object],[object Object]
 
 
 
Operator of Scope
Operator of Scope
Operator of Scope
Operator of Scope (::)  ,[object Object],[object Object],[object Object]
Inline or Not –inline Function? ,[object Object]
[object Object]
 
Reminders ,[object Object],[object Object]
Constructor ,[object Object]
Constructor ,[object Object],[object Object],[object Object]
 
Destructor ,[object Object]
Destructor ,[object Object],[object Object]
 
Overloading Constructors ,[object Object]
 
Reminder ,[object Object]
Default Constructor ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Parameterized Constructor ,[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Copy Constructor ,[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
include "stdafx.h" #include "iostream" using namespace std; class yanyan { public: char name[30]; char status[20]; int hours; float rate; int deductions; float salary; float compute(int hours, float rate, int deductions) { float salary; salary = (hours*rate) - deductions; return (salary); } }; yanyan a[100]; int employee,i;
int _tmain(int argc, _TCHAR* argv[]) { system(&quot;cls&quot;); cout<<&quot;Enter no. of employee: &quot;; cin>>employee; for (i=1;i<=employee;i++) { cout<<&quot;Enter employee name:  &quot;; cin>>a[i].name; cout<<&quot;Status? &quot;; cin>>a[i].status; cout<<&quot;No. of hours worked: &quot;; cin>>a[i].hours; cout<<&quot;Some deductions? &quot;; cin>>a[i].deductions; cout<<&quot;Enter hourly rate: &quot;; cin>>a[i].rate;
a[i].salary=a[i].compute(a[i].hours,a[i].rate,a[i].deductions); cout<<a[i].name; cout<<&quot; with status: &quot;; cout<<a[i].status; cout<<&quot; has a salary of &quot;; cout<<a[i].salary; } system(&quot;pause&quot;); return 0; }
1 sur 39

Recommandé

Java: Objects and Object References par
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object ReferencesTareq Hasan
17.9K vues29 diapositives
11 Using classes and objects par
11 Using classes and objects11 Using classes and objects
11 Using classes and objectsmaznabili
400 vues69 diapositives
Introduction to class in java par
Introduction to class in javaIntroduction to class in java
Introduction to class in javakamal kotecha
16.3K vues58 diapositives
Chapter 02: Classes Objects and Methods Java by Tushar B Kute par
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
8.4K vues89 diapositives
Classes&amp;objects par
Classes&amp;objectsClasses&amp;objects
Classes&amp;objectsM Vishnuvardhan Reddy
459 vues12 diapositives
Lect 1-java object-classes par
Lect 1-java object-classesLect 1-java object-classes
Lect 1-java object-classesFajar Baskoro
2.1K vues6 diapositives

Contenu connexe

Tendances

Classes and objects in java par
Classes and objects in javaClasses and objects in java
Classes and objects in javaMuthukumaran Subramanian
754 vues4 diapositives
ITFT-Classes and object in java par
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in javaAtul Sehdev
1.7K vues12 diapositives
Pi j3.2 polymorphism par
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphismmcollison
208 vues22 diapositives
Java class,object,method introduction par
Java class,object,method introductionJava class,object,method introduction
Java class,object,method introductionSohanur63
1.1K vues15 diapositives
Object and class par
Object and classObject and class
Object and classmohit tripathi
1.4K vues44 diapositives
Lect 1-class and object par
Lect 1-class and objectLect 1-class and object
Lect 1-class and objectFajar Baskoro
1.9K vues18 diapositives

Tendances(20)

ITFT-Classes and object in java par Atul Sehdev
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in java
Atul Sehdev1.7K vues
Pi j3.2 polymorphism par mcollison
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphism
mcollison208 vues
Java class,object,method introduction par Sohanur63
Java class,object,method introductionJava class,object,method introduction
Java class,object,method introduction
Sohanur631.1K vues
Class and Objects in Java par Spotle.ai
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai7K vues
Class and object in C++ par rprajat007
Class and object in C++Class and object in C++
Class and object in C++
rprajat00720.7K vues
Unit 2-data types,Variables,Operators,Conitionals,loops and arrays par DevaKumari Vijay
Unit 2-data types,Variables,Operators,Conitionals,loops and arraysUnit 2-data types,Variables,Operators,Conitionals,loops and arrays
Unit 2-data types,Variables,Operators,Conitionals,loops and arrays
DevaKumari Vijay288 vues
Week9 Intro to classes and objects in Java par kjkleindorfer
Week9 Intro to classes and objects in JavaWeek9 Intro to classes and objects in Java
Week9 Intro to classes and objects in Java
kjkleindorfer5.8K vues
Classes, objects in JAVA par Abhilash Nair
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair28.4K vues
Method overloading, recursion, passing and returning objects from method, new... par JAINAM KAPADIYA
Method overloading, recursion, passing and returning objects from method, new...Method overloading, recursion, passing and returning objects from method, new...
Method overloading, recursion, passing and returning objects from method, new...
JAINAM KAPADIYA1.1K vues
Class and object in c++ par NainaKhan28
Class and object in c++Class and object in c++
Class and object in c++
NainaKhan28387 vues

Similaire à Classes & objects new

Classes-and-Objects-in-C++.pdf par
Classes-and-Objects-in-C++.pdfClasses-and-Objects-in-C++.pdf
Classes-and-Objects-in-C++.pdfismartshanker1
4 vues30 diapositives
Class and object par
Class and objectClass and object
Class and objectprabhat kumar
100 vues27 diapositives
My c++ par
My c++My c++
My c++snathick
3.7K vues78 diapositives
3 functions and class par
3   functions and class3   functions and class
3 functions and classtrixiacruz
327 vues16 diapositives
Class and object in C++ By Pawan Thakur par
Class and object in C++ By Pawan ThakurClass and object in C++ By Pawan Thakur
Class and object in C++ By Pawan ThakurGovt. P.G. College Dharamshala
2.1K vues38 diapositives
+2 CS class and objects par
+2 CS class and objects+2 CS class and objects
+2 CS class and objectskhaliledapal
982 vues26 diapositives

Similaire à Classes & objects new(20)

My c++ par snathick
My c++My c++
My c++
snathick3.7K vues
3 functions and class par trixiacruz
3   functions and class3   functions and class
3 functions and class
trixiacruz327 vues
Object oriented design par lykado0dles
Object oriented designObject oriented design
Object oriented design
lykado0dles1.5K vues
object oriented programming language by c++ par Mohamad Al_hsan
object oriented programming language by c++object oriented programming language by c++
object oriented programming language by c++
Mohamad Al_hsan2.2K vues
C++ Object oriented concepts & programming par nirajmandaliya
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
nirajmandaliya1.5K vues
New microsoft office word document (2) par rashmita_mishra
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)
rashmita_mishra1.6K vues
C questions par parm112
C questionsC questions
C questions
parm112853 vues

Dernier

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T par
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
112 vues34 diapositives
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... par
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...ShapeBlue
146 vues15 diapositives
Why and How CloudStack at weSystems - Stephan Bienek - weSystems par
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
197 vues13 diapositives
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT par
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITShapeBlue
166 vues8 diapositives
Digital Personal Data Protection (DPDP) Practical Approach For CISOs par
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsPriyanka Aash
153 vues59 diapositives
"Surviving highload with Node.js", Andrii Shumada par
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
53 vues29 diapositives

Dernier(20)

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T par ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue112 vues
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... par ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue146 vues
Why and How CloudStack at weSystems - Stephan Bienek - weSystems par ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue197 vues
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT par ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue166 vues
Digital Personal Data Protection (DPDP) Practical Approach For CISOs par Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash153 vues
"Surviving highload with Node.js", Andrii Shumada par Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays53 vues
State of the Union - Rohit Yadav - Apache CloudStack par ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue253 vues
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue par ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 vues
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... par ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue154 vues
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... par ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue98 vues
Business Analyst Series 2023 - Week 4 Session 7 par DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10126 vues
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... par ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue117 vues
The Role of Patterns in the Era of Large Language Models par Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li80 vues
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... par ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue101 vues
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... par ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue79 vues
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue par ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue163 vues
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online par ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue181 vues
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue par ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue93 vues

Classes & objects new

  • 1. Classes & Objects Ms. Ma. Patricia B. Lina
  • 2.
  • 3.
  • 4. Class vs. Object Vehicle Car Animal Elephant Person Student Flower Rose
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.  
  • 12.  
  • 13.  
  • 17.
  • 18.
  • 19.
  • 20.  
  • 21.
  • 22.
  • 23.
  • 24.  
  • 25.
  • 26.
  • 27.  
  • 28.
  • 29.  
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. include &quot;stdafx.h&quot; #include &quot;iostream&quot; using namespace std; class yanyan { public: char name[30]; char status[20]; int hours; float rate; int deductions; float salary; float compute(int hours, float rate, int deductions) { float salary; salary = (hours*rate) - deductions; return (salary); } }; yanyan a[100]; int employee,i;
  • 38. int _tmain(int argc, _TCHAR* argv[]) { system(&quot;cls&quot;); cout<<&quot;Enter no. of employee: &quot;; cin>>employee; for (i=1;i<=employee;i++) { cout<<&quot;Enter employee name: &quot;; cin>>a[i].name; cout<<&quot;Status? &quot;; cin>>a[i].status; cout<<&quot;No. of hours worked: &quot;; cin>>a[i].hours; cout<<&quot;Some deductions? &quot;; cin>>a[i].deductions; cout<<&quot;Enter hourly rate: &quot;; cin>>a[i].rate;
  • 39. a[i].salary=a[i].compute(a[i].hours,a[i].rate,a[i].deductions); cout<<a[i].name; cout<<&quot; with status: &quot;; cout<<a[i].status; cout<<&quot; has a salary of &quot;; cout<<a[i].salary; } system(&quot;pause&quot;); return 0; }