SlideShare a Scribd company logo
1 of 1
Download to read offline
//DEBUG-3 //This program creates student objects //and overloads > to compare student gpas
#include<iostream> #include<conio.h> class Student { private: int stuID; int year; double gpa;
public: Student(const int i, const int y, const double g); int operator>(const Student otherStu); };
Student::Student() { stuID=i; year = y; gpa = g; } int operator>(const Student otherStu) { int great; if
(gpa > otherStu) great = 1; return(great); } void main() { Student a(111,2,3.50),b(222,1,3.00);
if(a>b) cout<<"Student a has the higher gpa"<<endl; getch(); }
______________________________
//DEBUG-4 //This program creates student objects //and overloads < to compare student year in
school #include<iostream> #include<conio.h> class Student { private: int stuID; int year; double
gpa; public: Student(const int i, const int y, const double g); void showYear(); Student& <(const
Student otherStu); }; Student::Student(const int i, const int y, const double g) { stuID=i; year = y;
gpa = g; } void Student::showYear() { cout<<year; } Student Student::operator<(const Student
otherStu) { int less = 1; if (year < otherStu.year) less = 1; return(otherStu); } void main() { Student
a(111,2,3.50),b(222,1,3.00); if(a<b) { a.showYear(); cout<<" is less than "; b.showYear(); } else {
a.showYear(); cout<<" is not less than "; b.showYear(); } cout<<endl; getch(); }
using C++

More Related Content

Similar to DEBUG3 This program creates student objects and overl.pdf

classes & objects.ppt
classes & objects.pptclasses & objects.ppt
classes & objects.pptBArulmozhi
 
Labsheet 7 FP 201
Labsheet 7 FP 201Labsheet 7 FP 201
Labsheet 7 FP 201rohassanie
 
What is new in sulu 2.0
What is new in sulu 2.0What is new in sulu 2.0
What is new in sulu 2.0danrot
 
Student.h #include stdafx.h #include string using names.pdf
Student.h #include stdafx.h #include string using names.pdfStudent.h #include stdafx.h #include string using names.pdf
Student.h #include stdafx.h #include string using names.pdffoottraders
 
CompletableFuture
CompletableFutureCompletableFuture
CompletableFuturekoji lin
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular ComponentsSquash Apps Pvt Ltd
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 studrohassanie
 
UNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptxUNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptxraunakkumar290158
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008xilinus
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportMatthew Zackschewski
 
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docxMorgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docxgilpinleeanna
 
Programming in C#Define an application to include classes for Stud.pdf
Programming in C#Define an application to include classes for Stud.pdfProgramming in C#Define an application to include classes for Stud.pdf
Programming in C#Define an application to include classes for Stud.pdffashionscollect
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdfaplolomedicalstoremr
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdflakshmijewellery
 

Similar to DEBUG3 This program creates student objects and overl.pdf (20)

classes & objects.ppt
classes & objects.pptclasses & objects.ppt
classes & objects.ppt
 
COW
COWCOW
COW
 
Labsheet 7 FP 201
Labsheet 7 FP 201Labsheet 7 FP 201
Labsheet 7 FP 201
 
3. Polymorphism.pptx
3. Polymorphism.pptx3. Polymorphism.pptx
3. Polymorphism.pptx
 
Inheritance
InheritanceInheritance
Inheritance
 
What is new in sulu 2.0
What is new in sulu 2.0What is new in sulu 2.0
What is new in sulu 2.0
 
operator overloading
operator overloadingoperator overloading
operator overloading
 
Student.h #include stdafx.h #include string using names.pdf
Student.h #include stdafx.h #include string using names.pdfStudent.h #include stdafx.h #include string using names.pdf
Student.h #include stdafx.h #include string using names.pdf
 
CompletableFuture
CompletableFutureCompletableFuture
CompletableFuture
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 stud
 
UNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptxUNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptx
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End Report
 
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docxMorgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
 
Programming in C#Define an application to include classes for Stud.pdf
Programming in C#Define an application to include classes for Stud.pdfProgramming in C#Define an application to include classes for Stud.pdf
Programming in C#Define an application to include classes for Stud.pdf
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
 
OOPS 22-23 (1).pptx
OOPS 22-23 (1).pptxOOPS 22-23 (1).pptx
OOPS 22-23 (1).pptx
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
Sunil
SunilSunil
Sunil
 

More from motilajain

Define the following terms related to cellular metabolism M.pdf
Define the following terms related to cellular metabolism M.pdfDefine the following terms related to cellular metabolism M.pdf
Define the following terms related to cellular metabolism M.pdfmotilajain
 
Denegacin de una solicitud Analice la siguiente carta Ide.pdf
Denegacin de una solicitud Analice la siguiente carta Ide.pdfDenegacin de una solicitud Analice la siguiente carta Ide.pdf
Denegacin de una solicitud Analice la siguiente carta Ide.pdfmotilajain
 
DEN1003 In Class Activity 3 Student Name Date 1 Label th.pdf
DEN1003 In Class Activity 3 Student Name Date 1 Label th.pdfDEN1003 In Class Activity 3 Student Name Date 1 Label th.pdf
DEN1003 In Class Activity 3 Student Name Date 1 Label th.pdfmotilajain
 
Demo d I 1020 cout ltlt endl ltlt Dl Object .pdf
Demo d I 1020 cout ltlt endl ltlt Dl Object  .pdfDemo d I 1020 cout ltlt endl ltlt Dl Object  .pdf
Demo d I 1020 cout ltlt endl ltlt Dl Object .pdfmotilajain
 
Demand P 160 15 Q Total Cost TC 225 Q 2 Part 1 Find.pdf
Demand P 160  15 Q Total Cost TC 225 Q 2 Part 1 Find.pdfDemand P 160  15 Q Total Cost TC 225 Q 2 Part 1 Find.pdf
Demand P 160 15 Q Total Cost TC 225 Q 2 Part 1 Find.pdfmotilajain
 
def search graph root sequence root visited set .pdf
def search graph root sequence  root  visited set .pdfdef search graph root sequence  root  visited set .pdf
def search graph root sequence root visited set .pdfmotilajain
 
Debra notes that Theo Chocolate has started holding its own .pdf
Debra notes that Theo Chocolate has started holding its own .pdfDebra notes that Theo Chocolate has started holding its own .pdf
Debra notes that Theo Chocolate has started holding its own .pdfmotilajain
 
Demonstrate the effect of the following shocks in the basic .pdf
Demonstrate the effect of the following shocks in the basic .pdfDemonstrate the effect of the following shocks in the basic .pdf
Demonstrate the effect of the following shocks in the basic .pdfmotilajain
 
Define blood pHDescribe how blood buffer systems contribute.pdf
Define blood pHDescribe how blood buffer systems contribute.pdfDefine blood pHDescribe how blood buffer systems contribute.pdf
Define blood pHDescribe how blood buffer systems contribute.pdfmotilajain
 
Define and give an example of Statistical method a m.pdf
Define and give an example of Statistical method       a m.pdfDefine and give an example of Statistical method       a m.pdf
Define and give an example of Statistical method a m.pdfmotilajain
 
Define health informatics the key players involved and the.pdf
Define health informatics the key players involved and the.pdfDefine health informatics the key players involved and the.pdf
Define health informatics the key players involved and the.pdfmotilajain
 
Define the following phenomena as acclimatization or adaptat.pdf
Define the following phenomena as acclimatization or adaptat.pdfDefine the following phenomena as acclimatization or adaptat.pdf
Define the following phenomena as acclimatization or adaptat.pdfmotilajain
 
Define a function called helloWorldn that accepts a number.pdf
Define a function called helloWorldn that accepts a number.pdfDefine a function called helloWorldn that accepts a number.pdf
Define a function called helloWorldn that accepts a number.pdfmotilajain
 
Define the exposome a Provide examples of the three broad .pdf
Define the exposome a Provide examples of the three broad .pdfDefine the exposome a Provide examples of the three broad .pdf
Define the exposome a Provide examples of the three broad .pdfmotilajain
 
Define a method printStateInfo that takes two string param.pdf
Define a method printStateInfo that takes two string param.pdfDefine a method printStateInfo that takes two string param.pdf
Define a method printStateInfo that takes two string param.pdfmotilajain
 
DEF Ltd has the following alternative planned activity level.pdf
DEF Ltd has the following alternative planned activity level.pdfDEF Ltd has the following alternative planned activity level.pdf
DEF Ltd has the following alternative planned activity level.pdfmotilajain
 
def FindNumDigitsnumber return lenstrabsnumber def .pdf
def FindNumDigitsnumber return lenstrabsnumber def .pdfdef FindNumDigitsnumber return lenstrabsnumber def .pdf
def FindNumDigitsnumber return lenstrabsnumber def .pdfmotilajain
 
Deere amp Company is a global manufacturer and distributor.pdf
Deere amp Company is a global manufacturer and distributor.pdfDeere amp Company is a global manufacturer and distributor.pdf
Deere amp Company is a global manufacturer and distributor.pdfmotilajain
 
Decisions for Tomorrow How much more output per year will ha.pdf
Decisions for Tomorrow How much more output per year will ha.pdfDecisions for Tomorrow How much more output per year will ha.pdf
Decisions for Tomorrow How much more output per year will ha.pdfmotilajain
 
Declining populations of honeybees and bumblebees is a major.pdf
Declining populations of honeybees and bumblebees is a major.pdfDeclining populations of honeybees and bumblebees is a major.pdf
Declining populations of honeybees and bumblebees is a major.pdfmotilajain
 

More from motilajain (20)

Define the following terms related to cellular metabolism M.pdf
Define the following terms related to cellular metabolism M.pdfDefine the following terms related to cellular metabolism M.pdf
Define the following terms related to cellular metabolism M.pdf
 
Denegacin de una solicitud Analice la siguiente carta Ide.pdf
Denegacin de una solicitud Analice la siguiente carta Ide.pdfDenegacin de una solicitud Analice la siguiente carta Ide.pdf
Denegacin de una solicitud Analice la siguiente carta Ide.pdf
 
DEN1003 In Class Activity 3 Student Name Date 1 Label th.pdf
DEN1003 In Class Activity 3 Student Name Date 1 Label th.pdfDEN1003 In Class Activity 3 Student Name Date 1 Label th.pdf
DEN1003 In Class Activity 3 Student Name Date 1 Label th.pdf
 
Demo d I 1020 cout ltlt endl ltlt Dl Object .pdf
Demo d I 1020 cout ltlt endl ltlt Dl Object  .pdfDemo d I 1020 cout ltlt endl ltlt Dl Object  .pdf
Demo d I 1020 cout ltlt endl ltlt Dl Object .pdf
 
Demand P 160 15 Q Total Cost TC 225 Q 2 Part 1 Find.pdf
Demand P 160  15 Q Total Cost TC 225 Q 2 Part 1 Find.pdfDemand P 160  15 Q Total Cost TC 225 Q 2 Part 1 Find.pdf
Demand P 160 15 Q Total Cost TC 225 Q 2 Part 1 Find.pdf
 
def search graph root sequence root visited set .pdf
def search graph root sequence  root  visited set .pdfdef search graph root sequence  root  visited set .pdf
def search graph root sequence root visited set .pdf
 
Debra notes that Theo Chocolate has started holding its own .pdf
Debra notes that Theo Chocolate has started holding its own .pdfDebra notes that Theo Chocolate has started holding its own .pdf
Debra notes that Theo Chocolate has started holding its own .pdf
 
Demonstrate the effect of the following shocks in the basic .pdf
Demonstrate the effect of the following shocks in the basic .pdfDemonstrate the effect of the following shocks in the basic .pdf
Demonstrate the effect of the following shocks in the basic .pdf
 
Define blood pHDescribe how blood buffer systems contribute.pdf
Define blood pHDescribe how blood buffer systems contribute.pdfDefine blood pHDescribe how blood buffer systems contribute.pdf
Define blood pHDescribe how blood buffer systems contribute.pdf
 
Define and give an example of Statistical method a m.pdf
Define and give an example of Statistical method       a m.pdfDefine and give an example of Statistical method       a m.pdf
Define and give an example of Statistical method a m.pdf
 
Define health informatics the key players involved and the.pdf
Define health informatics the key players involved and the.pdfDefine health informatics the key players involved and the.pdf
Define health informatics the key players involved and the.pdf
 
Define the following phenomena as acclimatization or adaptat.pdf
Define the following phenomena as acclimatization or adaptat.pdfDefine the following phenomena as acclimatization or adaptat.pdf
Define the following phenomena as acclimatization or adaptat.pdf
 
Define a function called helloWorldn that accepts a number.pdf
Define a function called helloWorldn that accepts a number.pdfDefine a function called helloWorldn that accepts a number.pdf
Define a function called helloWorldn that accepts a number.pdf
 
Define the exposome a Provide examples of the three broad .pdf
Define the exposome a Provide examples of the three broad .pdfDefine the exposome a Provide examples of the three broad .pdf
Define the exposome a Provide examples of the three broad .pdf
 
Define a method printStateInfo that takes two string param.pdf
Define a method printStateInfo that takes two string param.pdfDefine a method printStateInfo that takes two string param.pdf
Define a method printStateInfo that takes two string param.pdf
 
DEF Ltd has the following alternative planned activity level.pdf
DEF Ltd has the following alternative planned activity level.pdfDEF Ltd has the following alternative planned activity level.pdf
DEF Ltd has the following alternative planned activity level.pdf
 
def FindNumDigitsnumber return lenstrabsnumber def .pdf
def FindNumDigitsnumber return lenstrabsnumber def .pdfdef FindNumDigitsnumber return lenstrabsnumber def .pdf
def FindNumDigitsnumber return lenstrabsnumber def .pdf
 
Deere amp Company is a global manufacturer and distributor.pdf
Deere amp Company is a global manufacturer and distributor.pdfDeere amp Company is a global manufacturer and distributor.pdf
Deere amp Company is a global manufacturer and distributor.pdf
 
Decisions for Tomorrow How much more output per year will ha.pdf
Decisions for Tomorrow How much more output per year will ha.pdfDecisions for Tomorrow How much more output per year will ha.pdf
Decisions for Tomorrow How much more output per year will ha.pdf
 
Declining populations of honeybees and bumblebees is a major.pdf
Declining populations of honeybees and bumblebees is a major.pdfDeclining populations of honeybees and bumblebees is a major.pdf
Declining populations of honeybees and bumblebees is a major.pdf
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

DEBUG3 This program creates student objects and overl.pdf

  • 1. //DEBUG-3 //This program creates student objects //and overloads > to compare student gpas #include<iostream> #include<conio.h> class Student { private: int stuID; int year; double gpa; public: Student(const int i, const int y, const double g); int operator>(const Student otherStu); }; Student::Student() { stuID=i; year = y; gpa = g; } int operator>(const Student otherStu) { int great; if (gpa > otherStu) great = 1; return(great); } void main() { Student a(111,2,3.50),b(222,1,3.00); if(a>b) cout<<"Student a has the higher gpa"<<endl; getch(); } ______________________________ //DEBUG-4 //This program creates student objects //and overloads < to compare student year in school #include<iostream> #include<conio.h> class Student { private: int stuID; int year; double gpa; public: Student(const int i, const int y, const double g); void showYear(); Student& <(const Student otherStu); }; Student::Student(const int i, const int y, const double g) { stuID=i; year = y; gpa = g; } void Student::showYear() { cout<<year; } Student Student::operator<(const Student otherStu) { int less = 1; if (year < otherStu.year) less = 1; return(otherStu); } void main() { Student a(111,2,3.50),b(222,1,3.00); if(a<b) { a.showYear(); cout<<" is less than "; b.showYear(); } else { a.showYear(); cout<<" is not less than "; b.showYear(); } cout<<endl; getch(); } using C++