Buckys C++ Programming Tutorials - 5 - Creating a Basic Calculator

  Рет қаралды 1,010,191

thenewboston

thenewboston

Күн бұрын

Пікірлер: 715
@tazlex15
@tazlex15 9 жыл бұрын
"So now we're gonna be moving on to the next topic which is: I dunno, but it's gonna be amazing." LOL I love this guy :')
@domojestic4155
@domojestic4155 9 жыл бұрын
+Alexander Al Basosi 7:09
@Observ8or
@Observ8or 4 жыл бұрын
These lessons are still some of the best 9 years later
@AncienRegimeStudios
@AncienRegimeStudios 10 жыл бұрын
You know I've tried learning C++ and Python on multiple occasions and failed mainly because the crappy teachers immediately flew off and started doing all sorts of abstruse things without actually explaining what the hell they were doing or what was really going on. This series and this tutorial #5 in particular explained the C++ system better than any tutorial I've ever seen. Thank you bucky for providing clear explicit tutorials for the beginner that keep us coming back for more. You are a true Stakhanovite hero of the internets.
@gauharalikhan22
@gauharalikhan22 Жыл бұрын
Bro same happening with me now I am a beginner but now you will be a pro in this field it's a nine years now
@DawgTycoon
@DawgTycoon 13 жыл бұрын
This is so helpful, probably easier to learn from these videos than a class full of students
@achrafaffes5935
@achrafaffes5935 7 жыл бұрын
I'm a beginner here , and to make cout and cin easier to remember , think about as "console out" (cout) and "console in" (cin) ...
@dashcampower4622
@dashcampower4622 4 жыл бұрын
thats actually what it stands for lol
@janiskristofersvitols9413
@janiskristofersvitols9413 4 жыл бұрын
No shit
@hetaeramancer
@hetaeramancer 3 жыл бұрын
@@dashcampower4622 haha
@EricCartmanFTW
@EricCartmanFTW 2 жыл бұрын
cout stands for "character output".
@LukaReeson
@LukaReeson 7 жыл бұрын
Great tutorial. Plain and simple. I wanted to make this basic calc. code as an function. After a few tries, I did it. Here's the code: #include using namespace std; int calc(); int main() { cout
@mdgrace1990
@mdgrace1990 12 жыл бұрын
Thank you so much for your amazing videos. Seriously, you are an incredible teacher for what is often seen as a daunting subject. I recently downloaded Microsoft Visual C++ which not only took forever to download but when I ran their tutorial it was extremely confusing. I have learned more in less than an hour by watching your videos. Thanks for getting me pumped about learning to program!
@williambraddell1687
@williambraddell1687 7 жыл бұрын
Thank you so much. I've just started an IT degree and have been freaking out over the learning curve but your videos are so helpful.
@mjsomething5008
@mjsomething5008 3 жыл бұрын
Thank you, Without this video many people such as myself wouldn't know what is wrong and what to do so treat yourself
@GustavWallgren
@GustavWallgren 12 жыл бұрын
Bucky you are awesome. I figured I wanted to learn some C++, so what I did was I went to the library and borrowed a beginners guide. Then I went to your channel since I knew you are good at this stuff. With the help from you and the book, I have learned tons of stuff, even creating a (quite basic) calculator, supporting Addition, Subtraction, Division and Multiplication. I just wanted to say that you are awesome, and I want you to keep making videfos. Thank you, for making learning so fun!
@ArvsGamer
@ArvsGamer 12 жыл бұрын
u could also do this: int a, b, sum; i figured that out myself, i feel smart :)
@adoo8505
@adoo8505 4 жыл бұрын
Silent Crow u still alive?
@yar3_yar3
@yar3_yar3 4 жыл бұрын
@@adoo8505 lol
@yar3_yar3
@yar3_yar3 4 жыл бұрын
Thanks for that tip
@edgetransit3320
@edgetransit3320 4 жыл бұрын
@@adoo8505 hahahaahhhah wtf
@twistzo6737
@twistzo6737 4 жыл бұрын
he died due to corona virus
@slrjcismyrock2213
@slrjcismyrock2213 5 жыл бұрын
Thank you Bucky for the great series of tutorials. Helped me a lot to refresh my memory on C++ for my technical assessment for a job.
@TheRealStoveboldt
@TheRealStoveboldt 12 жыл бұрын
Have to say, I was skeptical at first that I wouldn't be able to grasp it. Little did I know, I knew more than I thought I did. This is coming along like second nature. Thanks.
@petergacov3668
@petergacov3668 10 жыл бұрын
Dude you have no idea how stupidly our teacher explains this stuff. I didn't have a clue as to what she was talking about after the first 4 min!
@karthiktata6715
@karthiktata6715 6 жыл бұрын
LMAO...
@saipai8114
@saipai8114 6 жыл бұрын
true
@saipai8114
@saipai8114 6 жыл бұрын
im late
@WeirdStuffaaaa
@WeirdStuffaaaa 4 жыл бұрын
yes same to me , their lectures no practical
@changye9604
@changye9604 10 жыл бұрын
bro i'm 12 and you made it so easy to understand thank you thank you !
@TheXxSPANKERxX
@TheXxSPANKERxX 9 жыл бұрын
Chang Ye Seriously is every comment section gonna have a " IM 3 AND I LIEK C++" No one fucking cares about your age and it doesn't make you look cool if that's what you're trying. So fucking please.
@changye9604
@changye9604 9 жыл бұрын
Its nice to get your opinion
@changye9604
@changye9604 9 жыл бұрын
Its nice to get your opinion
@changye9604
@changye9604 9 жыл бұрын
Its nice to get your opinion
@changye9604
@changye9604 9 жыл бұрын
Its nice to get your opinion
@kitinpancel6545
@kitinpancel6545 7 жыл бұрын
Ive been programming for a year, and my hardest code so far was indeed a calculator, which worked with extremely large numbers too.
@lib7656
@lib7656 8 жыл бұрын
Your vids are amazing! thank you for thoroughly explaining everything! I've learned more from you in the last 5 vids than from two 50 min comp classes
@elijahmasquelier1238
@elijahmasquelier1238 8 жыл бұрын
omg forgot a semicolon and watched the video like 5 times to see what i did wrong..
@afioyhac5432
@afioyhac5432 7 жыл бұрын
well u get an error and its says expected ; in some row
@jaylensmith6308
@jaylensmith6308 6 жыл бұрын
Can you imagine making a whole game to find out one small mistake messed it up I know it’s possible
@alexsawyer8467
@alexsawyer8467 6 жыл бұрын
@@jaylensmith6308 Dude you act as though you code an entire game at once and then compile it. You aren't gonna write an entire game without any form of testing until the very end are you? I never write more than a hundred lines of code at once unless I'm sure of what I'm about to do.
@jaylensmith6308
@jaylensmith6308 6 жыл бұрын
Alex Sawyer okay first off, I’m still learning the ropes for coding. I know there’s developers who look over any mistakes nor have ways for the software to check for itself. I was making a joke, don’t take it too far on what ‘You’ would do.
@jaylensmith6308
@jaylensmith6308 6 жыл бұрын
Alex Sawyer second, this comment is 6 months old. From there I’ve learned many things that programming and code does
@bigzeem757
@bigzeem757 12 жыл бұрын
The compiler reads in order from left to right and line by line, so when it gets to sum=a+b you are going to get non declared variable errors, or you could end up not having the values that the user entered used. It would use the value for whatever old number was previously stored there in that memory slot.
@RCTestKid
@RCTestKid 9 жыл бұрын
Great tutorials! You kept it interesting to stop me from becoming bored, have followed all 5 in a row so far! Now moving onto 6!
@nancyasper6731
@nancyasper6731 3 жыл бұрын
9 years later. Thank You!
@ScreenPrintR
@ScreenPrintR 10 жыл бұрын
Thanks again Bucky. Thought I'd study your tutorials to bring myself up to speed in C++. I see you can still make some decent money programming part time. Even if you only know C++, HTML, CSS and JavaScript.
@hoangphipham2737
@hoangphipham2737 4 жыл бұрын
2020 and I still watching him. Im the freshman and his videos are more interesting than my 45 mins lectures...
@Ethaninja
@Ethaninja 13 жыл бұрын
Thanks to these tutorials I was able to make a much more complex calculator. Never got it fully working but it did function properly. Cheers bucky
@Shippudenk
@Shippudenk 9 жыл бұрын
Great tutorials! "Pretty cool, Ha?" always makes me laugh ^_^ Keep it up!
@Blaze-oi6nr
@Blaze-oi6nr 4 жыл бұрын
I am a coder and frankly i think thus guy is awesome .I am totally recommending this to a friend of mine who is completely new to coding. Good job man!
@Turtl3Gam1ng
@Turtl3Gam1ng 10 жыл бұрын
The basics are the most important, I watched an entire Lua tutorial but was never taught the BASICS so had a hard time understanding. Eventually, on my own I had gotten a grip on what the foundational things are according to lua (although I could've swithced tuts or searched it on google). I like this tutorial because they're not 25 minutes each episode, and they're easy to understand.
@nabilfikri8511
@nabilfikri8511 6 жыл бұрын
one of the youtuber that I will never skip ads,hope can contribute small amount of revenue 😳❤
@sriramiyer7504
@sriramiyer7504 11 жыл бұрын
i just made a huge calc . it can add,subtract,multiply,divide,find the remainder,calculate squares,cubes,and also square roots.and all that with ur help.u rock bucky!!!!!!!!!!!!!!
@rafangofur
@rafangofur Жыл бұрын
All I can say is this tutorial is very good even after 12 years.
@bjarnes.4423
@bjarnes.4423 8 жыл бұрын
I don't know why, but I get super excited every time I see this stuff. I tried out Java, but C++ is way more amazing, Thanks!! :D
@rukagi
@rukagi 7 жыл бұрын
Java's kinda similar to c++ tho...
@nizaral-assi3173
@nizaral-assi3173 7 жыл бұрын
the way you explain this lesson is quite good. Thanks
@JamesTsividis
@JamesTsividis 11 жыл бұрын
coming from visual basic, C++ is so much more efficient. i am in awe
@wmx
@wmx 10 жыл бұрын
I love this guy, no blabber just straight to the point! :)
@BlookerG
@BlookerG 11 жыл бұрын
cout
@hitmanekoyslnp8572
@hitmanekoyslnp8572 4 жыл бұрын
Why not use /n
@zaidharithah5738
@zaidharithah5738 3 жыл бұрын
@@hitmanekoyslnp8572 i was thinking the same question too, u got the answer man?
@hitmanekoyslnp8572
@hitmanekoyslnp8572 3 жыл бұрын
@@zaidharithah5738 to be honest its still not Cannot complete the series and cant code c++ my computer wont oppen the codeblock so I to post pone until I buy new laptop
@theengineeringstudent2678
@theengineeringstudent2678 4 жыл бұрын
Bucky Roberts, the one who is responsible for I learn programming.
@PaezRice
@PaezRice 11 жыл бұрын
just wanna mention another possibility... you can also write: cout
@turwaa1
@turwaa1 12 жыл бұрын
im practicing this summer for class next year, may sound like a geek, but i love programming keep up the great work bucky!!
@theengineeringstudent2678
@theengineeringstudent2678 4 жыл бұрын
The way you explain is just awesome!
@asifraj321
@asifraj321 6 күн бұрын
You made it very easy to understand. Thank you 👍
@akingofdashit
@akingofdashit 11 жыл бұрын
more specifically: COUT stands for console output CIN stands for console input that's why the first line of the code is include iostream iostream is inputoutputstream
@MichaelFishwick
@MichaelFishwick 8 ай бұрын
Thank You!, you made that very to understand. Liked and subbed.
@Yash-qe3bv
@Yash-qe3bv 9 жыл бұрын
Pretty Cool Huh!
@asustufa1515
@asustufa1515 7 жыл бұрын
xD
@dibbiepk
@dibbiepk 12 жыл бұрын
Well, if your going to do it like "enter first number" "enter next" then you will have to loop it (I dont know if you learned looping yet), and say after they press H then it stops the loop and does the operation for them. As for the operation number, ud have to do something like "operation?" add "number?" 10 "operation?" dived "number?" 3, then have it say something like "10 + 10 / 3 =" So every time they enter a number, it asks what operation they want to do, and adds it to the equation.
@zaidharithah5738
@zaidharithah5738 3 жыл бұрын
The best youtuber in teaching c++
@mdyusufnadaph6869
@mdyusufnadaph6869 4 жыл бұрын
Very good explanation in easier way.
@salih-khan
@salih-khan 5 жыл бұрын
Physics coding you teach everything love you big fan Edit: to make it better you should put up an option for different operations so 1 = addition and that type then you should use a switch case or if else. Variable so check for other operations From there you can have the different operation in functions and be looped
@scott22v
@scott22v 7 жыл бұрын
Exactly what i needed. I had to make a tuition calculator for class. Great video thank you
@DazKins
@DazKins 13 жыл бұрын
@SuperHappyvideo its because each variable has a set limit to how big it has to be. This will make more sense when you learn about pointers
@TheaDragonSpirit
@TheaDragonSpirit 12 жыл бұрын
You make it really simple to follow. I have done some C++ before and I didn't realise a few things :-)
@Milkycraft
@Milkycraft 12 жыл бұрын
Right on, java was the best thing to learn, I'm watching a bunch of these tutorials from many playlists and all of them start off the same, bucky explaining variables and methods (functions), strings, etc. C++ and javascript are both pretty cool :D
@liauqilun
@liauqilun 12 жыл бұрын
thx for the awesome tutorial.i don't even know what is c++ and i have idea about it after watching this tutorial
@MusicFlowLofi
@MusicFlowLofi 2 жыл бұрын
man, u should make c++ full course video or other programming full course video, ur explanation is the best
@ChannelMinecrafter
@ChannelMinecrafter 12 жыл бұрын
Thanks so much; I tweaked around from what I learned so now after I enter a number it sais 'enter another number to add with (number entered here)'. This is so easy to understand, thanks!
@mikematij2
@mikematij2 8 жыл бұрын
Thanks Matt Damon cant wait to get to the videos I don't know yet!!
@faz4321
@faz4321 13 жыл бұрын
@lacsapix Yes you don't want to be calculated uninitialized variables. You most definitely have to do the calculations after you have received the user input for A and B. If you try write "sum = a + b" before the program asks the user what they want to calculate it will result it using default uninitialized values which are usually big numbers. It's like trying to ask someone to calculate something before you tell them what to calculate.
@ianiket0013
@ianiket0013 9 жыл бұрын
Basic calculator #include using namespace std; int main() { int a; int b; int sum; int subtraction; int multiply; int divide; cout > a; cout > b; sum = a + b; subtraction = a - b; multiply = a * b; divide = a / b; cout
@DukeThatSpooks
@DukeThatSpooks 9 жыл бұрын
***** That's interesting, wonder how you could make it so you can make the input decide what equation would be printed instead of showing all of it at once (Multiplication etc etc). My guess would be using 'if' but I have yet to try it.
@FlipJanson_
@FlipJanson_ 9 жыл бұрын
***** It goes sum, difference, product, and quotient. Get it rite boi.
@beri4138
@beri4138 7 жыл бұрын
The division will not work properly because 'divide' is an integer. As a result, the fractional part of the calculation will be truncated. To fix this, you should declare it a float and use typecasting to calculate the division this way: float divide = (float)a/(float)b; Watch Bucky's video about typecasting in C for reference. Aside from that, great program!
@sujanrijalepic
@sujanrijalepic 4 жыл бұрын
This prints everything at once. How do you make the choice for what you want to do with the numbers. say the user only wants to calculate sum ??
@humanoid931sijc
@humanoid931sijc 11 жыл бұрын
Thanks for the tyutorials, now I've made my very own Advance Calculator that support Square Root, Cube Roots, Additions, Subtractions, Multiplications, and Divisions.
@bhargavsrini
@bhargavsrini 13 жыл бұрын
If you have an int it supports only data upto 32 bits, that is 2^32. Hence it would give you a random answer if you exceed that limit
@izelkay
@izelkay 11 жыл бұрын
I don't know if you guys are joking or not (I apologize ahead of time if you are), but cout stands for "character output" and cin stands for "character input".
@skylerfether7184
@skylerfether7184 10 жыл бұрын
if you make b=12 and then take out the area where you enter b, then change it from adding the number to multiplying them, you can calculate you age in months
@turwaa1
@turwaa1 12 жыл бұрын
learning with bucky is actually fun
@NormDoow
@NormDoow 11 жыл бұрын
yeah! i was surprised how much of a review this was after knowing alot of the beggining stuff in java
@PvPSAGE
@PvPSAGE 8 жыл бұрын
thank you so much this playlist is great so far
@zailiner
@zailiner 12 жыл бұрын
The first camera created was a pin hole camera, instead of using digital lazy crap, they used a small box with a small hole on it that allowed in to expose the paper that had chemicals on it, the light reacted with the chemicals and created the picture.
@nerd_yboi8771
@nerd_yboi8771 4 жыл бұрын
Amazing, words cannot express how much you're helping me out. :)
@robenkk
@robenkk 11 жыл бұрын
"cin >>b" is not a print command. It is only telling the program to read the next user input and store it in variable place holder "b", so there will be nothing that appears as readable text on the screen. The previous line was a print command which ended in "/n", so the program prints "Enter another number" and moves to the next line of text, which is the next "cout" command. Anything that's not a "cout" command will not appear as text or take up lines in the output. Does that clarify?
@floralpoboop
@floralpoboop 12 жыл бұрын
int a, b, sum; Does it shorter and faster while taking up less data. If your going to declare the variables you might as well do it that way especially if a person decides to make hundreds of variables.
@sujanrijalepic
@sujanrijalepic 4 жыл бұрын
Character In and character OUT. Nice Video .
@DingbatsRealm
@DingbatsRealm 11 жыл бұрын
by changing int a; int b; int sum; to: float a; float b; float sum; you can do decimal questions
@martichoras
@martichoras 11 жыл бұрын
Could also have been a float. In that case I would advise you to use a double or long double :) What you need is the setprecision(x) manipulator where x is desired digit-length. Remember to #include iomanip :)
@abirneji
@abirneji 10 жыл бұрын
After 15 episodes go back and watch them again just to make sure that you know everything
@blackzack61g
@blackzack61g 11 жыл бұрын
thanks for these vids man. your the reason im going to pass my class. your doing the lords work, or at least my teachers. Thanks again!
@ryanhackett9768
@ryanhackett9768 10 жыл бұрын
Anand Nair "plz explain the difference between and " iostream.h is depreciated, and iostream is its more modern replacement. The iostream library was created as part of the standardization of C++, whereas iostream.h predates the standardization of C++, back to the early days of CFront (the first C++ compiler).
@bamidelechristiana6305
@bamidelechristiana6305 4 жыл бұрын
Your teaching is amazing
@kobtv7380
@kobtv7380 3 жыл бұрын
Thank You you helped me in my exam. Love yu
@iandrsaurri625
@iandrsaurri625 9 жыл бұрын
i thought that making an adding program would be a much more daunting task not only 21 lines of code, now that's awesome
@SleepBecomesYou
@SleepBecomesYou 12 жыл бұрын
When you declared your variables (a and b) you were asking the compiler to reserve two spaces in memory (RAM) associated with those variables. Often memory is reused and contains data from a program that ran before. Because you didn't wipe out/overwrite that memory before calculating sum, sum was calculated using the values previously stored in memory. Even though you changed a and b later on in the program sum had already been calculated so it made no difference to the weird value in sum.
@krauwieplays5519
@krauwieplays5519 7 жыл бұрын
i got a small question, If i want a space inbetween the last awnser and the next question, where can i add another endl; or I tried putting it behind the variables so i had like cin >> b; endl; However this didnt exactly work out. would i have to add it infront of the next rule? endl
@rcx8666c
@rcx8666c 8 жыл бұрын
BUCKY IS A GREAT TUTOR...
@penifest09
@penifest09 13 жыл бұрын
@CShelper I don't understand your question. What do you mean? Are you asking if this is the same as using Microsoft Visual C++ or something? If so, then yeah. Microsoft Visual C++ is a program that has a lot more features than codeblocks but it is essentially the same thing: writing, compiling, and running code.
@UjjwalKumarJha-raymando
@UjjwalKumarJha-raymando 9 жыл бұрын
I got a question guys. In the last video as far as I can remember, Bucky had wrote sum=a+b with the starting int itself. While I was trying the code for myself, I did the same and I got some weird negative number as the sum. Why is it so? Does it mean I can not write : int x; int y; int sum=x+y; Hope this is not a stupid question, but yeah I began today :D I did rewrite the code as sum = x+y cout
@lacsapix
@lacsapix 13 жыл бұрын
be sure to put "sum = a + b;" AFTER the cin >> a&b. else it will just output a ridiculous high number.
@pingiproduction7290
@pingiproduction7290 Жыл бұрын
The code is: int a; int b; int z; cin >> a; cin >> b; z=a+b; cout
@tkblackbelt2
@tkblackbelt2 13 жыл бұрын
@SuperHappyvideo It's because 1000000000000 is a 39 bit number and a int can only hold up to a 32 bit number. A unsigned int can hold a number from 0 to 4294967295 and a signed int can hold from -2147483648 to 2147483647 because the left most bit is used as a flag to determine if the number is negative or positive
@StanbyMode
@StanbyMode 4 жыл бұрын
God his explaining is so good
@thavrisco1632
@thavrisco1632 8 жыл бұрын
The only videos I watch from Bucky are his old videos
@magica2z
@magica2z 6 жыл бұрын
Love your videos and way explain things.. Cheers
@DavidBoura
@DavidBoura 5 жыл бұрын
I finally can see plus plus, thank you!
@Madgod711
@Madgod711 11 жыл бұрын
You're an awesome teacher. Thank you so much for these great videos, you have helped me so much!
@freddy5092
@freddy5092 8 жыл бұрын
For me when i type the second number and press enter, the program closes itself...What should I do ? I did everything as you did...I am using visual studio...
@jennifergonzalez6431
@jennifergonzalez6431 6 жыл бұрын
I don't understand why he put "
@abdul-8JbC5
@abdul-8JbC5 7 жыл бұрын
this buckey is becoming my captain america
@gunjanrajtiwari1435
@gunjanrajtiwari1435 4 жыл бұрын
This is the best tutorial I think if it is upto date. If not please update it.
@AnkitJainCreations
@AnkitJainCreations 11 жыл бұрын
Hi, Thank you for sharing the knowledge. Can you please tell me why you have typed - using namespace std;?
@Qwyst
@Qwyst 11 жыл бұрын
"So now that you've got that done, we can begin moving on to the next topic, which is...I dunno. But trust me, it's gonna be amazing!"
@iLuvTofu20
@iLuvTofu20 13 жыл бұрын
@SuperHappyvideo Because the legal values of the int variable are from -2,147,483,648 to 2,147,483,647.
@michielidema3239
@michielidema3239 9 жыл бұрын
Wow c++ is so much better than java. to build the exact same calculator in java costs u like 3 times more text. This is so much easier
@kraeukai
@kraeukai 13 жыл бұрын
finally something interesting i love you bucky
@ronggong
@ronggong 11 жыл бұрын
amazing videos!! but just one question TT TT whenever I enter the two numbers... and press enter, the sum briefly shows up and crashes TT how doi prevent that??
Buckys C++ Programming Tutorials - 6 - Variables Memory Concepts
3:45
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 15 МЛН
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 108 МЛН
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 59 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
basics of CODING in 10 minutes
15:34
The StudyTube Project
Рет қаралды 1,5 МЛН
Buckys C++ Programming Tutorials - 8 - if Statement
7:15
thenewboston
Рет қаралды 749 М.
Buckys C++ Programming Tutorials - 13 - Using Variables in Classes
9:12
thenewboston
Рет қаралды 1,1 МЛН
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 253 М.
CONST in C++
12:54
The Cherno
Рет қаралды 407 М.
Buckys C++ Programming Tutorials - 9 - Functions
9:04
thenewboston
Рет қаралды 1,2 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 15 МЛН