📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time. Code from this video: float num1, num2; char operation; cout > operation >> num2; switch (operation) { case '-':cout
Are you familiar with % operator and the way that it works? If not, there is a tutorial about operators in C++ in this playlist. All of the operators that I mention in that tutorial are used very often and among them '%' (modulo) operator, so please watch that, and that should explain some things. If you have any further questions after that, I'll help you. It's this tutorial: ua-cam.com/video/RP3BWoep69U/v-deo.html
Here is commented code for case '%' case '%': bool isNum1Int, isNum2Int; isNum1Int = ((int)num1 == num1);//check if 1st number is an integer /*When you cast decimal point number, ex. 5.5, into an int, the value of that int will be 5 And if you cast 5.0 into an int, the value of that int will be 5 as well That means that you can compare int(num)==num, and that will beresult in one of these two options: option 1. int(5.5)==5.5, which results in 5==5.5
Really really thanks for these awesome tutorials. Being a girl I feel really empowered to see you code and it urges me to work even harder. I've no words to tell you how much you inspire me. Love you.
That is the best thing that you can tell me because I know how hard programming was for me in the beginning. Also, you can apply the logic that you learn in C++ to many other programming languages, because it is going to teach you how things work on a very deep level. Some other languages hide that complexity, some don't, but it is easier to learn higher lvl programming language after C++ than vice versa. 🤓
I was happy to find that I could do the % integer checking with a little more dense code. To me it seems a little tidier and you don't need those additional booleans. But I get why you used them to make it more easier to understand! I did it like this: case '%': if ((int)num1 == num1 && (int)num2 == num2) cout
Hi Another brilliant video. There is one option that is not considered and that is for the modulo option where num1 < num2. I have written four lines to be included after line 20 which seems to work. if (num1 < num2) cout
Yeah I noticed the same issue with the letter "e" and if used it does not send the invalid operation message by default. I checked many other letters and it works fine but not for "e".. Thank you for the lessons btw much appreciated.
Hello I really admire how deep you are in the programming. Can you please take me through some tutorials? I'm a student doing computer science and I have little challenges Pleasssssssse
In the past six hours I have gone from learning how to print hello world to making a calculator app. A lot of these UA-camrs make c++ tutorials but they don't even come close to you!
great tutorial, but wouldnt it be easier for the cases to just copy and paste all 5 operators' code and just change the '+', etc, and the num1 + num2, etc, or would that mess up the syntax?
I did that things you say hackers do without the default option and it just jumps one line and after that it shown that long message and the console went out when I pressed other button.
we can figure out if the number is integer or not by typecasting the float value into integer and then subtracting that from the float value if the result is zero then the number is integer...is it correct? Edit: omg i overdid it..
@CodeBeauty - Just want to compliment you on your videos so far and that you really are a beauty. Second, I'm trying to make a calculator that will ONLY work out the area and perimeter of a circle. Do you have a video on how to do this? I look forward to anything you might have to show me regarding this and I'm really loving your videos so fa, so well done and keep it up! :D
Thank you very much for these lessons. I'm doing c++ this semester and your videos are being really helpful. I have a question concerning this video. You used bool and if statement to convert the % to int. I used the same thing and it worked but I was wondering if there's a simpler way to do it. Because, even though I followed your steps but I didn't understand the isNumInt you used. So I used the concepts you taught on the ASCII table by writing "int(num1)%int(num2)" and I got the same answer without the bool and if statement. I want to know if it's ok to do it like this or is there a difference?
Yes, there's a huge difference! If you use "int(num1)%int(num2)" instead of an if-else statement, you just transform float numbers into int numbers. Let's see an example: if your program gets the input "10.5 % 3.6" the result will be "10 % 3 = 1" instead of "Not valid!". As you see the result will be misleading, because if you divide (with) a float number, there should be no residue after division. The if-else and the bool is not used for conversion, it's only used to check that the num1 and int(num1) are the same value. (Like 5.0 == 5)
ummm hi saldina...I just wanna add that up till now we have not studied loops so we can't do iterations or repeat the code...we have to run the program again and again...so we could just add goto statement outside the switch which will help repeat the code again and again...Thanks
Thank you for the great videos! I'm building the switch statement calculator for class using ifstream and for some reason the last statement always repeats itself. I'm using breaks and a while (!fin.eof())
Saldina, whatever was hidden behind those **BEEPS**, I'm guessing those were some really good adjectives for our hacker🤣🤣. Thanks anyways for your efforts; I'm so grateful for you.
My solution was creating another set of int variables, named int1 and int2 Then creating an if else statement of "if((int)num1==num1 and (int)num2==num2) {int1=num1; int2=num2; cout
Hello Saldina, I watched your video and tried to write code that checks if insert number has int type or something else, and here what I got : ) bool isNum1True, isNum2True; if (num1 / int(num1) != 1 || num2 / int(num2) != 1) { isNum1True = false; isNum2True = false; } cout
How we create a calculator with all operations and contain round and square parentheses use a minimum of 3 classes the classes should contain at least one dynamically allocated char array, a dynamically allocated numerical array, a constant field, a static field, and a static method. The members should be class-related. for example [(2*3)^2]/4-(6+2)#3, where x^y means x at power y and x#y means y order root from x, will output 7. the calculator will take the input from the console. The user will have the ability to write equations and entering the app will display the result. The calculator will accept input until the user types ‘exit’ . Can you make a tutorial!! Thank you
It's really hard to code in mobile phone:( It does not work properly. It's so hard to study in this situation which i can't afford to buy laptop or pc. My mind say's "just give up" but here i am still doing my best:|
@@CodeBeauty I see. Anyone who speaks English will understand. Don't you worry. A word of advice. If you are passionate about teaching on UA-cam you just have to be persistent. 12-18 months before your channel will grow in a meaninful way. Also you can try Twitch streaming. Other things too if you need advice. 👍
That is a good question, and I wrote the answer to very similar one on another video. I'll link the video that has that question in the comments, and my answer to it, so that might help you to understand this better 😊 It is a question from Stefan Skoric, where he asked about counting digits of a decimal number, and it is in this video ua-cam.com/video/jWISn6pk-XU/v-deo.html
I declared two new int variables instead of using the (int)num1: int v1,v2; v1 = num1; v2 = num2; if (v1==num1) {isNum1Int = True;} else {isNum1Int = False;}; if (v2==num2) {isNum2Int = True;} else {isNum2Int = False;};
@Afrasyap Hazerfen It is because you are using integer numbers. In the first line you declare them as: int int1, int2; So your int1 and int2 are of int type, and % is allowed on integers. If you declared num1 and num2 as float or double, you wouldn't be able to use % operation on those numbers, and you would get an error.
i did this code with static cast #include using namespace std; int main() { float num1, num2; char operation; cout num1 >> operation >> num2; switch (operation) { case '-': cout
Shut Fucking Operation, it's ok btw you have built this code spending your precious time what if someone hacks your code. my reaction would be also the same.
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
Code from this video:
float num1, num2;
char operation;
cout > operation >> num2;
switch (operation)
{
case '-':cout
I have not understood the "%" part
please can you explain it in detail...........
the bool part
Are you familiar with % operator and the way that it works?
If not, there is a tutorial about operators in C++ in this playlist.
All of the operators that I mention in that tutorial are used very often and among them '%' (modulo) operator, so please watch that, and that should explain some things.
If you have any further questions after that, I'll help you.
It's this tutorial: ua-cam.com/video/RP3BWoep69U/v-deo.html
@@CodeBeauty i had already watched it...
Great explaination....
Here is commented code for case '%'
case '%':
bool isNum1Int, isNum2Int;
isNum1Int = ((int)num1 == num1);//check if 1st number is an integer
/*When you cast decimal point number, ex. 5.5, into an int, the value of that int will be 5
And if you cast 5.0 into an int, the value of that int will be 5 as well
That means that you can compare int(num)==num, and that will beresult in one of these two options:
option 1. int(5.5)==5.5, which results in 5==5.5
Really really thanks for these awesome tutorials. Being a girl I feel really empowered to see you code and it urges me to work even harder.
I've no words to tell you how much you inspire me. Love you.
This whole playlist is so informative i have learned so many new things watching these videos thank u so much
🤞💗💗
Your explanations are so adequate!!! Thanks for your hardwork.
🥰
Thank you for your tutorial I could understand this language.
these videos are really easy to understand you are doing an amazing job! also c++ is so similar to python
That is the best thing that you can tell me because I know how hard programming was for me in the beginning.
Also, you can apply the logic that you learn in C++ to many other programming languages, because it is going to teach you how things work on a very deep level.
Some other languages hide that complexity, some don't, but it is easier to learn higher lvl programming language after C++ than vice versa. 🤓
I was happy to find that I could do the % integer checking with a little more dense code. To me it seems a little tidier and you don't need those additional booleans. But I get why you used them to make it more easier to understand!
I did it like this:
case '%':
if ((int)num1 == num1 && (int)num2 == num2)
cout
-Which previous tutorial?-
Hi
Another brilliant video.
There is one option that is not considered and that is for the modulo option where num1 < num2. I have written four lines to be included after line 20 which seems to work.
if (num1 < num2)
cout
Atleast one video/ one day I'm learning from you.Thanks a million.
Yeah I noticed the same issue with the letter "e" and if used it does not send the invalid operation message by default. I checked many other letters and it works fine but not for "e".. Thank you for the lessons btw much appreciated.
Well explained, nice!
Thank you very much!
Hello
I really admire how deep you are in the programming.
Can you please take me through some tutorials? I'm a student doing computer science and I have little challenges
Pleasssssssse
In the past six hours I have gone from learning how to print hello world to making a calculator app. A lot of these UA-camrs make c++ tutorials but they don't even come close to you!
I liked very much the ending. Just as in the catoons a little devil in a shoulder and litte angel on the other one discussing between each other
great tutorial, but wouldnt it be easier for the cases to just copy and paste all 5 operators' code and just change the '+', etc, and the num1 + num2, etc, or would that mess up the syntax?
you are my hero your videos are easy to understand , i'm going to create my own computer too . thank you
i had to watch this 5 times just to understand it logically, great tutorial btw
So finally I've built my own calculator Application, thx mam for this tutorial.
I did that things you say hackers do without the default option and it just jumps one line and after that it shown that long message and the console went out when I pressed other button.
we can figure out if the number is integer or not by typecasting the float value into integer and then subtracting that from the float value
if the result is zero then the number is integer...is it correct?
Edit: omg i overdid it..
This was extremely helpful!!! Thank you!!!
@CodeBeauty - Just want to compliment you on your videos so far and that you really are a beauty. Second, I'm trying to make a calculator that will ONLY work out the area and perimeter of a circle. Do you have a video on how to do this? I look forward to anything you might have to show me regarding this and I'm really loving your videos so fa, so well done and keep it up! :D
Thank you very much for these lessons. I'm doing c++ this semester and your videos are being really helpful. I have a question concerning this video. You used bool and if statement to convert the % to int. I used the same thing and it worked but I was wondering if there's a simpler way to do it. Because, even though I followed your steps but I didn't understand the isNumInt you used. So I used the concepts you taught on the ASCII table by writing "int(num1)%int(num2)" and I got the same answer without the bool and if statement. I want to know if it's ok to do it like this or is there a difference?
Yes, there's a huge difference! If you use "int(num1)%int(num2)" instead of an if-else statement, you just transform float numbers into int numbers. Let's see an example: if your program gets the input "10.5 % 3.6" the result will be "10 % 3 = 1" instead of "Not valid!". As you see the result will be misleading, because if you divide (with) a float number, there should be no residue after division. The if-else and the bool is not used for conversion, it's only used to check that the num1 and int(num1) are the same value. (Like 5.0 == 5)
ummm hi saldina...I just wanna add that up till now we have not studied loops so we can't do iterations or repeat the code...we have to run the program again and again...so we could just add goto statement outside the switch which will help repeat the code again and again...Thanks
Goto is bad practice. I don't know why your teacher is insisting on it, but at least you should remember that 🙌
Very nice video
Keep it up!
its amazing, I really learn , Just Saldina !
I didn't understand the bool part that receives the cast value to int.
The code is nice and all
but what happens if you divide it by zero the answer is inf
so
you can do this code
case '/':
if(n2 != 0.0)
cout
Thank you for the great videos!
I'm building the switch statement calculator for class using ifstream and for some reason the last statement always repeats itself. I'm using breaks and a while (!fin.eof())
What was that beeping noise while typing the default output string?
I need a refresher with the other videos.
Saldina, whatever was hidden behind those **BEEPS**, I'm guessing those were some really good adjectives for our hacker🤣🤣. Thanks anyways for your efforts; I'm so grateful for you.
WOW ! Saldina you good make sample "variable" use in programming like dish and glass!
very thanks
#ROYALNIL
My solution was creating another set of int variables, named int1 and int2
Then creating an if else statement of "if((int)num1==num1 and (int)num2==num2)
{int1=num1;
int2=num2;
cout
thank beautiful for your work. best regards
Hello Saldina, I watched your video and tried to write code that checks if insert number has int type or something else, and here what I got : )
bool isNum1True, isNum2True;
if (num1 / int(num1) != 1 || num2 / int(num2) != 1) {
isNum1True = false;
isNum2True = false;
}
cout
Ok, it's just wrong (
How we create a calculator with all operations and contain round and square parentheses use a minimum of 3 classes the classes should contain at least one dynamically allocated char array, a dynamically allocated numerical array, a constant field, a static field, and a static method. The members should be class-related. for example [(2*3)^2]/4-(6+2)#3, where x^y means x at power y and x#y means y order root from x, will output 7. the calculator will take the input from the console. The user will have the ability to write equations and entering the app will display the result. The calculator will accept input until the user types ‘exit’ . Can you make a tutorial!! Thank you
why other characters such as "^" was not included?
Thank you so much
am new can someone explain this worked or is wrong??
case '%':
cout
It's really hard to code in mobile phone:( It does not work properly. It's so hard to study in this situation which i can't afford to buy laptop or pc. My mind say's "just give up" but here i am still doing my best:|
Thanks so much for the knowledge Salina can I get your
Great turtorial. Unusual accent, where are you from? 😊
I think that I have an Eastern European accent. I hope it’s easy to understand :D
I currently live in Mostar :)
@@CodeBeauty I see. Anyone who speaks English will understand. Don't you worry. A word of advice. If you are passionate about teaching on UA-cam you just have to be persistent. 12-18 months before your channel will grow in a meaninful way. Also you can try Twitch streaming. Other things too if you need advice. 👍
How can we use relational operators in switch function 🤔
The videos are wonderful.
Thanks so much.
Thank you for your tutorial .it's easy to understand. But why
If i have a number = 1.23
num-int(num)
The result doesn't =.23
But = .229178
That is a good question, and I wrote the answer to very similar one on another video. I'll link the video that has that question in the comments, and my answer to it, so that might help you to understand this better 😊
It is a question from Stefan Skoric, where he asked about counting digits of a decimal number, and it is in this video
ua-cam.com/video/jWISn6pk-XU/v-deo.html
Thanks for explaining that in detail. It's pretty nice from you
thanks, mam💕💖
I declared two new int variables instead of using the (int)num1:
int v1,v2;
v1 = num1;
v2 = num2;
if (v1==num1) {isNum1Int = True;} else {isNum1Int = False;};
if (v2==num2) {isNum2Int = True;} else {isNum2Int = False;};
I Don't know why ..But i'm getting 7 errors:
int main()
{
float input1, input2;
char operation;
cout > input1 >> operator>> input2;
switch (operation)
{
case '-':cout
"operation" wrong in "cin" line and swtich section.
i didnt get the % error?? why??
Give me your code and I'll tell you why. :D :P
Paste your code here 😊
@Afrasyap Hazerfen It is because you are using integer numbers.
In the first line you declare them as: int int1, int2;
So your int1 and int2 are of int type, and % is allowed on integers.
If you declared num1 and num2 as float or double, you wouldn't be able to use % operation on those numbers, and you would get an error.
why do you always look so beautiful.
you look even more beautiful with glasses
i am a big fan of your tetorial c ++
thank you @codebeauty
Comment for Algor
i did this code with static cast #include
using namespace std;
int main()
{
float num1, num2;
char operation;
cout num1 >> operation >> num2;
switch (operation)
{
case '-': cout
she's a very smart beauty
// calculator for operators +, -, *, /.
#include
using namespace std;
int main()
{
float num1,num2;
char op;
cout > op;
cout num1 >> num2;
switch (op)
{
case '+':
cout
22:00
English is not my native language, so I couldn't understand just by moving your mouth.
Shut Fucking Operation, it's ok btw you have built this code spending your precious time what if someone hacks your code. my reaction would be also the same.
#include
using namespace std;
int main() {
while (true) {
float n1, n2;
char op;
cout > n1;
cout > n2;
cout > op;
if (op == 'q' || op == 'Q')
break;
switch (op) {
case '*':
cout
lol i tryed too to cast them to int . Just with int num1 , didnt know u can just "cast/convert" (int)num1 . Thanks