You are a great teacher.I have searched many course and I haved done those. But every one's teaching method is not so learning friendly like you. That's why everyone watchs your cousrse
/* create 2 classes: 1.simpleCalculator-> takes input of two numbers using utility function and perform +,-,*,/ and displays the result using another function. 2.ScientificCalculator->takes input of two numbers using utility function and perform any four scientific operations of your choice and display the result using another function. Now create another Hybridcalculator and inherit the above two claases in it. */ #include #include using namespace std; class simple_calculator{ protected: float x,y; public: char opr_S; void set_numbers(int a,int b){ x=a; y=b; } void Operands(){ cout
//No special calling required. Simply create an object of HybridCalculator class and everything will happen automatically (: #include #include using namespace std; class SimpleCalculator{ protected: int add(int a,int b); int substraction(int a,int b); int product(int a,int b); double divide(int a,int b); public: void useSimpleCalc(int num1,int num2){ cout
bro but its not memory efficient because when you inherited (HybridCalculator Class) form (SimpleCalculator Class) and (Scientific Calculator) and made an object of (HybridCalaculator Class) then all the 5 functions of (SimpleCalculator Class) and all the 5 functions of (ScientificCalculator Class) will get added in (HybridCalculator Class) then (HybridCalculato Class) have to allocate memory for all the 10 functions. If you just wanted to compare the user choice and run the required function then what is the point of making the class , you could have done it by just making functions. And also you used if() statements rather then switch() statements for just checking the user choice which made the compiler to check all the if() and else if() statements. You could have used switch() statement to just jump over the choices which make the compiler to do less work and could have made the code fast.
9:32 int की जगह float लेना था। 13:57 ambiguity दूर करने के लिए अगले वीडियो में जो लिखा था ,वो यहां दिखाया 12:30 पर ,लेकिन कुछ इस्तेमाल नहीं किया ,सिर्फ दोनो फंक्शन के मैथड के नाम rename कर दिए!
Pin This Harry Bhai : if you verify these sin cos and tan values you'll find they are wrong but truly they aren't wrong...because sin(parameter) take values in radians not in degrees so to get correct value for degree use sin(parameter*PI/180) same for cos and tan... Note: here parameter is the input value in degrees and you need to declare PI value to 3.14159265 Code: #include #include using namespace std; const double PI = 3.14159265; class SimpleCalculator{ int a,b; public: void getdataSimp(){ cout
/* 1. I am using multi-level inheritance 2. public mode 3. code reusability is implemented in this programm by using multi-level inheritance */ #include using namespace std; class simpcal { protected: int a,b; public: int x,y; void setvalues() { a=x; b=y; } void displaysimp() { cout
/* Create 2 classes: 1. SimpleCalculator - Takes input of 2 numbers using a utility function and performs +, -, *, / and displays the results using another function. 2. ScientificCalculator - Takes input of 2 numbers using a utility function and performs any four scientific operations of your choice and displays the results using another function. Create another class HybridCalculator and inherit it using these 2 classes: Q1. What type of Inheritance are you using? //multiple inheritance Q2. Which mode of Inheritance are you using? //Public inheritance Q3. Create an object of HybridCalculator and display results of the simple and scientific calculator. Q4. How is code reusability implemented? */ #include #include using namespace std; class SimpleCalculator{ protected: int n1,n2; public: void takeval(){ cout
i used get data as 1st class operation in derived class and solution as multiple derivation of both data initializer and operation to show result the aim was to try as many oops concept in it
Sir. Love from Bangladesh. ... I have a request for you... plzzzzzz make videos on WordPress. ........plzzzzzz Thank you for everything. ..... And respect for you .... Tnx.. #wordpress #tnx Bye. ..... And plz reply to this comment. ......
i think i made more advanced and friendly calculator here i do not meant that haary sir you make very simple program but i want to show you and wants your sugguestion on it
4:27 kiya tha maine solve par jab aap solve kr rhe ho to aur bhi ache se samajh aa rha hai like suddenly solution ko dekhne ka nazariya badal gya jaise hi aapne solve krna shuru kiya
Respected harry sir kya scientific calculator me +,_,*,/ nahi hota hai. if I use these oparations in scientific calculator then we have to use virtual in simple calculator.right sir??
yes we can do that by using single inheritance on classes simple and scientific... after that we can use the variables a and b in both of the classes...
class HybrideCalculator : public SimpleCalculator,public ScientificCalculator{ }; Simple calculator and then Scientific calculator can be done whithout writing it 🙃✌
Sir can we do it with multilevel inheritance by this way we will not get ambiguity at time of setting the variables . But in this we have to do variable public.
Sir please ek video banao jisme django models ke har field ke bare me batao jaise manytomany foreign key waigrh saaree ache se explain krdo sir plsss 🙏🙏🙏🙏🙏
//my code #include #include using namespace std; /* Create 2 classes: 1. SimpleCalculator - Takes input of 2 numbers using a utility function and performs +, -, *, / and displays the results using another function. 2. ScientificCalculator - Takes input of 2 numbers using a utility function and performs any four scientific operations of your choice and displays the results using another function. Create another class HybridCalculator and inherit it using these 2 classes: Q1. What type of Inheritance are you using? Q2. Which mode of Inheritance are you using? Q3. Create an object of HybridCalculator and display results of the simple and scientific calculator. Q4. How is code reusability implemented? */ class simpleCalculator { float a,b; public: void getDataSimple() { cout
The private functions cannot be called directly by the inherited class..the inherited class has to use an inherited function(getdata) to call the private variables..
its because it is using the base function so if we create a function in derieved class and try to use a,b it will give an error. so the thing is that i created a function print(){ cout
@paritosh Kabra its because the program we called in derived class is public you can access public function anywhere in code but you can't access private datamembers of its class so if you will try to access a and b directly in derived function you cant do that. Hope this helped
i rly overthought this exercise man #include #include using namespace std; class SimpleCalculator { public: char choice; int a, b; void setnum(int x, int y) { a = x; b = y; } int mul() { return a * b; } int add() { return a + b; } int sub() { return a - b; } int div() { if (b != 0) { return a / b; } else { cout
#include using namespace std; class SimpleCalculator { int a; int b; public: void set1(int x, int y) { a = x; b = y; } protected: void print1() { printf("Sum is %d Difference is %d Muliplication is %d Division is %f ", a + b, a - b, a * b, a * 1.0f / b); } }; class ScientificCalculator { int c; int d; public: void set2(int x, int y) { c = x; d = y; } protected: void print2() { cout
hello sir maina apki sari videos dakhi ha apka samjhana ka tarika bohat acha laga mujha sir ek app ko confg kar rha hu android studio mai but kuch error a rha ha to please aap help kijiya please sir
hey guys here is the solution : . . . v #include #include using namespace std; class simple_calculator{ protected: int a,b; public: void set_numbers( int num1 , int num2){ a=num1; b=num2; } void print_numbers(void){ cout
can anyone tell me when the data members from both the classes i.e., a simple calculator and scientific calculator are inherited by the hybrid calculator, why we did not create virtual base classes? as the hybrid class will have ambiguity about the data members?
No hybrid class will not get ambiguity.... Because the data members in simple calculator and scientific are different... We get ambiguity only when data members gets repeted... If simple calculator and scientific calculator are inherited from any other class then we would get ambiguity
Bhai mein aapse pichle 3 videos se puch raha hu programming setup ke upar ek video banane keliye aap tho reply bhi nhi kar rahe ho bhai please is matter ko dekho....
Could you please make a project in C++ which include many of the topics covered by you in c++ course ?
+1
+2
+1
+2
Me in college
You are a great teacher.I have searched many course and I haved done those. But every one's teaching method is not so learning friendly like you. That's why everyone watchs your cousrse
/*
create 2 classes:
1.simpleCalculator-> takes input of two numbers using utility function and perform +,-,*,/ and displays the result using another function.
2.ScientificCalculator->takes input of two numbers using utility function and perform any four scientific operations of your choice and display the result using another function.
Now create another Hybridcalculator and inherit the above two claases in it.
*/
#include
#include
using namespace std;
class simple_calculator{
protected:
float x,y;
public:
char opr_S;
void set_numbers(int a,int b){
x=a;
y=b;
}
void Operands(){
cout
Same as my code but i used if else statment switchs are better way
Thanxs
Challenge Accepted
#include
#include
using namespace std;
class SimpleCalculator
{
int a;
int b;
public:
void input1(void)
{
cout b;
}
void displayresult1()
{
cout
Thanks a lot for providing solutions ❤️❤️
We can also make calculator using switch case (that make real one and has more sense).
Indeed you can, i made one want to look?
:)
I have done it correctly broo..
I'm very happy that im going in a correct way of learning with your vedios .. thanks a lot ..
Commenting for better reach because this guy is awesome
Harry bhaiya.. Maine bhi aap ke jaisa same banaya tha 😅thxx
Bro I Learned HTML VERY WELL
It's because of you
What you are doing now?
@@331sachinkiragi8 🤘👽
//No special calling required. Simply create an object of HybridCalculator class and everything will happen automatically (:
#include
#include
using namespace std;
class SimpleCalculator{
protected:
int add(int a,int b);
int substraction(int a,int b);
int product(int a,int b);
double divide(int a,int b);
public:
void useSimpleCalc(int num1,int num2){
cout
bro but its not memory efficient because when you inherited (HybridCalculator Class) form (SimpleCalculator Class) and (Scientific Calculator) and made an object of (HybridCalaculator Class) then all the 5 functions of (SimpleCalculator Class) and all the 5 functions of (ScientificCalculator Class) will get added in (HybridCalculator Class) then (HybridCalculato Class) have to allocate memory for all the 10 functions.
If you just wanted to compare the user choice and run the required function then what is the point of making the class , you could have done it by just making functions.
And also you used if() statements rather then switch() statements for just checking the user choice which made the compiler to check all the if() and else if() statements. You could have used switch() statement to just jump over the choices which make the compiler to do less work and could have made the code fast.
and also another thing that why did you make even functions also if you could easily just print the result.
wtf dude
Love you bhai.Thanks alot You are Helping me so much.🙏🙏🙏
a/b ko float me typecast karna chahiye th. It will not return 0 for values less than 1 and also make it precise.
Thankyou Brother for all this videos
9:32 int की जगह float लेना था। 13:57 ambiguity दूर करने के लिए अगले वीडियो में जो लिखा था ,वो यहां दिखाया 12:30 पर ,लेकिन कुछ इस्तेमाल नहीं किया ,सिर्फ दोनो फंक्शन के मैथड के नाम rename कर दिए!
Pin This Harry Bhai :
if you verify these sin cos and tan values you'll find they are wrong but truly they aren't wrong...because sin(parameter) take values in radians not in degrees so to get correct value for degree use sin(parameter*PI/180) same for cos and tan...
Note: here parameter is the input value in degrees
and you need to declare PI value to 3.14159265
Code:
#include
#include
using namespace std;
const double PI = 3.14159265;
class SimpleCalculator{
int a,b;
public:
void getdataSimp(){
cout
We can also use #include ?
Great harry bhaiii thnxx
Yr yeh Jo a tha wo private ni tha?? Private tu inherit hu hi ni sakta 😑
#include
#include // OR #include
using namespace std;
class SimpleCalculator
{
protected:
int num1, num2;
public:
void set_numbersSimple()
{
cout num1;
cout num2;
}
int sum()
{
return num1 + num2;
}
int subtract()
{
return num1 - num2;
}
int difference()
{
return abs(num1 - num2);
}
int product()
{
return num1 * num2;
}
float division()
{
return (float)num1 / num2;
}
void display_01()
{
cout
Thank you. You are great I. I. Tian kharagpur.
awesome explanation
thank you harry :)
/*
1. I am using multi-level inheritance
2. public mode
3. code reusability is implemented in this programm by using multi-level inheritance
*/
#include
using namespace std;
class simpcal
{
protected:
int a,b;
public:
int x,y;
void setvalues()
{
a=x;
b=y;
}
void displaysimp()
{
cout
U r legend 💪..
Love you Harry bhai dil se ❤
Ab bhaiya ek project banao class ki help se taki aur mazza aye😁
/*
Create 2 classes:
1. SimpleCalculator - Takes input of 2 numbers using a utility function and performs +, -, *, / and displays the results using another function.
2. ScientificCalculator - Takes input of 2 numbers using a utility function and performs any four scientific operations of your choice and displays the results using another function.
Create another class HybridCalculator and inherit it using these 2 classes:
Q1. What type of Inheritance are you using? //multiple inheritance
Q2. Which mode of Inheritance are you using? //Public inheritance
Q3. Create an object of HybridCalculator and display results of the simple and scientific calculator.
Q4. How is code reusability implemented?
*/
#include
#include
using namespace std;
class SimpleCalculator{
protected:
int n1,n2;
public:
void takeval(){
cout
Very Big fan Harry bhai
bro u are great
include
#include
using namespace std ;
class simplecalculator{
protected:
float a,b;
public:
void set_numbers(float l,float k){
a=l;
b=k;
}
void calculation1(){
cout
5:52
Are harry bhai kya baar baar save karo, uper file me jaake auto save on kardo na.
HOW ???
Are bahut sahi bhai
sir plz make some projects jese apne pythone ke course me game banayi hai as a project so plz make projects by c++
Please make a tutorial on Deep learning with tensorflow ♥️
Thanks Harry Bhaiya
i used get data as 1st class operation in derived class and solution as multiple derivation of both data initializer and operation to show result the aim was to try as many oops concept in it
Nice video 👌
Please make a tutorial for computer architecture and organisations
Sir. Love from Bangladesh. ...
I have a request for you... plzzzzzz make videos on WordPress. ........plzzzzzz
Thank you for everything. .....
And respect for you
....
Tnx..
#wordpress
#tnx
Bye. .....
And plz reply to this comment. ......
cout
Bhaiya please Oops in Python par video bna dijiye 🙏🙏🙏🙏
Not great but greatest and the best... Love u bro ..
i think i made more advanced and friendly calculator
here i do not meant that haary sir you make very simple program
but i want to show you and wants your sugguestion on it
switch-case??
4:27 kiya tha maine solve par jab aap solve kr rhe ho to aur bhi ache se samajh aa rha hai like suddenly solution ko dekhne ka nazariya badal gya jaise hi aapne solve krna shuru kiya
Respected harry sir kya scientific calculator me +,_,*,/ nahi hota hai.
if I use these oparations in scientific calculator then we have to use virtual in simple calculator.right sir??
By any way can we use both simple and scientific calculator in hybrid by accepting the value of a & b only once.
yes we can do that by using single inheritance on classes simple and scientific...
after that we can use the variables a and b in both of the classes...
Thank you so much Harryyyyyyy
#include
#include
using namespace std;
class Simplecalculator{
private:
int x,y;
public:
void setdata(){
couty;
}
void simple(){
cout
class HybrideCalculator : public SimpleCalculator,public ScientificCalculator{
};
Simple calculator and then Scientific calculator can be done whithout writing it 🙃✌
Love u bro.🖤🖤. plzz make a PDF of website questions...🙏🙏
Sir can we do it with multilevel inheritance by this way we will not get ambiguity at time of setting the variables . But in this we have to do variable public.
Thank you
thank you bhai
Improving reach
ambiguity resolution use nhi kia?
Great video
Harry bhai
Aisa kar sakte hai kya ki
Input sirf one time lena pade user se and all the operations are performed once ?
If yes how?
Please make video on app development for project
harry bhaii ,
a , b to private members the base classes me
frr vo hybridcalculator vaali class me inherit kese ho gye aapke solution me
bhai usne a,b ko direct access nhi kiya ,balki by using mehod kiya isliya error nhi aaya
Using function we can access
Please give us task in every video like this
Big fan first❤️
Harry bhai please make tutorials on React Native JavaScript Android App Development
Biggest fan ever
Thank you harry bhai
You are amazing...
Yr yeh Jo a tha wo private ni tha?? Private tu inherit hu hi ni sakta 😑
@@usmanshahid3381 a and b dono private hai..agar aap usko define nahi karte ho toh vo private function he hote hai.
Harry bhia plzz aak python se extension banan sikho...
Jise koi bhi flash sale phone ko buy krne me help kre.....
Amazon ya flipkart se
Thnc bro it is useful
either sir we can use switch function for it... for simple calculator isnt it
sir??
Sir please ek video banao jisme django models ke har field ke bare me batao jaise manytomany foreign key waigrh saaree ache se explain krdo sir plsss 🙏🙏🙏🙏🙏
Sin() and cos() ka value sehi nahi ho rah hain ?
mtlb?
Enter the value in radian mode or convert the degree value into radian and pass the value to fnction
Good video bro
Bhai Kabhi live bhi aao
Qna krna please
I use switch case so we can perform specific Operation
//my code
#include
#include
using namespace std;
/*
Create 2 classes:
1. SimpleCalculator - Takes input of 2 numbers using a utility function and performs +, -, *, / and displays the results using another function.
2. ScientificCalculator - Takes input of 2 numbers using a utility function and performs any four scientific operations of your choice and displays the results using another function.
Create another class HybridCalculator and inherit it using these 2 classes:
Q1. What type of Inheritance are you using?
Q2. Which mode of Inheritance are you using?
Q3. Create an object of HybridCalculator and display results of the simple and scientific calculator.
Q4. How is code reusability implemented?
*/
class simpleCalculator
{
float a,b;
public:
void getDataSimple()
{
cout
I also made same.. it looks more accurate as a calculator
@@AdarshKumar-bp6bc hmm thanks 😅
How the private variables of base classes in the program were excessed by the inherited class when the get_data function was called?....anyone?
same ques
The private functions cannot be called directly by the inherited class..the inherited class has to use an inherited function(getdata) to call the private variables..
its because it is using the base function so if we create a function in derieved class and try to use a,b it will give an error.
so the thing is that i created a function print(){ cout
@paritosh Kabra its because the program we called in derived class is public you can access public function anywhere in code but you can't access private datamembers of its class so if you will try to access a and b directly in derived function you cant do that. Hope this helped
Harry bhaiyaa what is the difference between cmath and math.h?
i rly overthought this exercise man
#include
#include
using namespace std;
class SimpleCalculator
{
public:
char choice;
int a, b;
void setnum(int x, int y)
{
a = x;
b = y;
}
int mul()
{
return a * b;
}
int add()
{
return a + b;
}
int sub()
{
return a - b;
}
int div()
{
if (b != 0)
{
return a / b;
}
else
{
cout
Harry bhai software development ka full course kahan mile ga
Bhai please make complete " Java" series please bhai 🙏🙏🙏🙏🙏
so the thing is that i created a function print(){ cout
i have used 2.7182 instead of exp.
Sir how to code ai in pydroid or qpython ?????
Bhaiya please video dalo na ish playlist me...kabse video nhi a raha
Bhai please make complete course on Java please bhai 🙏🙏🙏🙏🙏
#include
using namespace std;
class SimpleCalculator
{
int a;
int b;
public:
void set1(int x, int y)
{
a = x;
b = y;
}
protected:
void print1()
{
printf("Sum is %d
Difference is %d
Muliplication is %d
Division is %f
", a + b, a - b, a * b, a * 1.0f / b);
}
};
class ScientificCalculator
{
int c;
int d;
public:
void set2(int x, int y)
{
c = x;
d = y;
}
protected:
void print2()
{
cout
I have done it but used switch case so i have control on what operation program is doing
hello sir maina apki sari videos dakhi ha apka samjhana ka tarika bohat acha laga mujha sir ek app ko confg kar rha hu android studio mai but kuch error a rha ha to please aap help kijiya please sir
Harry bhai division me decimal number nahi arhe hai..
hey guys here is the solution :
.
.
.
v
#include
#include
using namespace std;
class simple_calculator{
protected:
int a,b;
public:
void set_numbers( int num1 , int num2){
a=num1;
b=num2;
}
void print_numbers(void){
cout
Hye sir data Science c++ ke video bnao
Please make tutorials on unity coding.plzz
Harry bhai you have not check my program ,that I commented in video no. 42 please check it once and correct my mistakes..
mene to conditions aur constructors laga ke kiya tha
Sir ek topic pr 5 qstions at least mil jata
. practice krne ko toh sahi hota h..plzz sir..plzz
operator overloading padha do bhaiya
can anyone tell me when the data members from both the classes i.e., a simple calculator and scientific calculator are inherited by the hybrid calculator, why we did not create virtual base classes? as the hybrid class will have ambiguity about the data members?
No hybrid class will not get ambiguity.... Because the data members in simple calculator and scientific are different... We get ambiguity only when data members gets repeted... If simple calculator and scientific calculator are inherited from any other class then we would get ambiguity
Bhai mein aapse pichle 3 videos se puch raha hu programming setup ke upar ek video banane keliye aap tho reply bhi nhi kar rahe ho bhai please is matter ko dekho....
Plese sir make a video of c++game
And what we can do with c++
Constructors in Derived Class in C++
operator overloading kaa topic baaki hai c++ may
Bhai web development plz with java css and html
Done