CS50 Problem Set 2 - Readability (Step by Step Walkthrough for Beginners)

  Рет қаралды 74,355

CS50 Made Easy with Rahul

CS50 Made Easy with Rahul

Күн бұрын

Пікірлер: 230
@zc3094
@zc3094 Жыл бұрын
The problem with these CS50 homework is that they always require some extra knowledge that didn't teach in class😂 Thank you! You helped me a lot!
@e.telizondotavernier4232
@e.telizondotavernier4232 Жыл бұрын
fr like wtf lol
@LifeLongArtist
@LifeLongArtist Жыл бұрын
there are practice problems on the bottom of the list that gives you the notes and slides before you watch the presentation
@RiddhiiSharma
@RiddhiiSharma Жыл бұрын
For sure 😂
@justarandomguy-gn2tu
@justarandomguy-gn2tu 10 ай бұрын
bump into small problems on the way, do a bit of research on your own to find out how to solve them - that's the way of life not only just programming my guy 💪
@sinless
@sinless 10 ай бұрын
Yeah seriously. They expect us to use the round function without ever teaching us that it even exists...
@sangois91
@sangois91 2 жыл бұрын
I just want to let you know that you are helping people everywhere, I'm Brazilian, and today, I came to say thank you for these videos. The way you explain make me see the problem from other point of view. Thank you, please don't stop with these videos
@MrAv3rag3
@MrAv3rag3 2 жыл бұрын
Disse tudo. Brazil appreciates it!👏👏
@cortesnalata
@cortesnalata 2 жыл бұрын
@@MrAv3rag3 very good kkkkk
@felipefigueiredoavelar
@felipefigueiredoavelar 2 жыл бұрын
kkkkk eu também
@artico1664
@artico1664 Жыл бұрын
ih rapaz eu n to sozinho kkkk
@williamkenzo3825
@williamkenzo3825 2 ай бұрын
me too kkkk. terminaram o cs50? como foi? did NOT expect finding some home boys over here.
@thecryptobeard
@thecryptobeard 2 жыл бұрын
Thanks bro, when I started I kept having to rewind. Now I'm actually pausing because I know the answer and am finishing before you get done explaining. Awesome job my man!
@bawnix4700
@bawnix4700 7 ай бұрын
so you're telling me it gets better because holy crap its humbling, it feels like im trying to learn how to walk again.
@setagangastudios574
@setagangastudios574 2 жыл бұрын
You helped me see something that was so plainly obvious just by looking at it logically instead of programmatically. Definitely earned my sub!
@ashmitmishra
@ashmitmishra 3 жыл бұрын
Big brother, the way you explain the topic, it feels like I have subscribed a online course by paying some amount.
@CS50MadeEasy
@CS50MadeEasy 3 жыл бұрын
Haha, thanks man. Means a lot!
@artyomd8842
@artyomd8842 2 жыл бұрын
Hi, thanks for the video. Actually the CS50 instruction said we had to do all the letters/words/sentences counting through the separate functions, and not inside the main. I suppose they want us to get used to handle functions properly. Also, correct me if I'm wrong, but your expanded code for counting letters has some mistakes. You made it: "if text[i] > 65". But this won't include 'A' because 'A' is 65. It's not grater than 65, it's 65, so it should be "if text[i] >= 65". Same with "less than 122" it won't count "z".
@e-d-ig.c2417
@e-d-ig.c2417 2 жыл бұрын
faca um video, existem poucos videos voce parece saber o que esta falando e eu preciso de ajuda kkkk
@hokaloah100
@hokaloah100 2 жыл бұрын
This was the last big mistake I found in my project. Once I figure it out my code worked perfectly
@abdullahshahzad333
@abdullahshahzad333 2 жыл бұрын
Dude my head was about to explode. Thank you so much. You are a savior
@Xatraris
@Xatraris 8 ай бұрын
That explains why my scrabble was slightly off. I went ahead and used the isupper and islower parts in the library to fix the problem. Was just trying to figure out why. Thanks!
@gamingwithgeko7377
@gamingwithgeko7377 2 жыл бұрын
I get the concept of coding but I'm having trouble remembering the rules and building blocks. But I'm sure if I continue to put in as much effort as I did learning all the tedious physics in several video games, I'm sure I can get this too... so I can make video games haha. Thanks so much these tutorials help allot and I'm constantly pausing, replaying, and practicing with the video off. I mostly just wanna make it all the way through this course as thoroughly as I can and then move on to actually learning C# so I can make games and probably html or python so I can make side money in the mean time. Really looking forward to the future, thanks again.
@jakekayden4061
@jakekayden4061 Жыл бұрын
Hey, did you keep learning?
@rikkiwebber3200
@rikkiwebber3200 Жыл бұрын
The for loop can also be written like this using the ctype header file. for (int i = 0; i < strlen(text); i++) { if (isalpha(text[i])) { letters++; } else if (isspace(text[i])) { words++; } else if (ispunct(text[i])) { sentences++; } }
@muraliks8617
@muraliks8617 Жыл бұрын
Truly appreciate you taking time to upload these videos, it is very clear and simple. Thank you!
@its_seabass9668
@its_seabass9668 2 жыл бұрын
Just wanted to mention that I tried checking it with the original equation (without the isalpha function) and had several errors. But as soon as I added it everything went away. Definitely a nice tool to have
@velenvskaelhas
@velenvskaelhas 2 жыл бұрын
Also if you read the specification on the CS50 site it does let you know what you'll need.
@ahmadaltahan7745
@ahmadaltahan7745 2 жыл бұрын
Make sure you include 65, 90, 97, and 122 by using >= and
@bmagaziner
@bmagaziner Жыл бұрын
@@ahmadaltahan7745 thank you, this made me want to strangle him while i watched
@mohammedel-hayek3383
@mohammedel-hayek3383 2 жыл бұрын
A friend of mine has recommended me this tutorial. And i couldn't' be more happier
@NintendoFanatic21
@NintendoFanatic21 2 жыл бұрын
holy crap. you know your stuff! i havent seen this so easily demonstrated anywhere!
@leongrundmann1846
@leongrundmann1846 2 жыл бұрын
Thanks for the helpful video! Helped me to solve the problem set. I just paused when I knew what you said, so I could still try to solve the problem on my own, using your video just when I was completely lost
@houston7497
@houston7497 2 жыл бұрын
I love the way you explain the logic in your videos. Hope you continue to make some more videos!
@ciaranbusiness
@ciaranbusiness 3 ай бұрын
Brother you help me bridge the learning gap between lecture and assessments. God bless you.
@parzgodedits
@parzgodedits 7 ай бұрын
Man, you are a life-savior. Thanks a lot
@FranklynAgbeko
@FranklynAgbeko 6 ай бұрын
thanks, a lot from the beginning things looked a bit difficult but watching your videos makes me feel I can do it. once again thanks you are a chap you should consider teaching 🙏🙏🙏🙏
@karimanajim6286
@karimanajim6286 Жыл бұрын
omg thank you sooo so much, I was having a lot of trouble understanding this but you explained it all so well, you are such a good teacher, keep going!!!
@ali-xperia71
@ali-xperia71 7 ай бұрын
Thanks a lot! even two years later this is very helpful! I might buy you a coffee some day!
@hokaloah100
@hokaloah100 2 жыл бұрын
Thank you again, so much for these videos. I'm happy to say that I only needed this video to prod me in the right direction a few times. My code definitely isn't as pretty as yours, but I did write it mostly by myself. There were even a few times when I was stuck and checking with this video, and as soon as you said, "let's think it through logically," it was like a light bulb would go off in my head and I'd fix my problem before seeing what you did.
@grich__
@grich__ 2 жыл бұрын
When using the original code to find out how many letters there are be sure to add an equal sign (=) to your less than and greater than signs (< , >) they should read as follows.......[ text[i]
@PeterDee-m2q
@PeterDee-m2q 10 ай бұрын
Thanks Rahul for your work in explaining the code walk through for the Readability exercise. The conditional if statement for printf helped me to better design my solution. Peadar - Ireland
@theinhtite9696
@theinhtite9696 2 жыл бұрын
Brother your video is a saint. Thank you for explaining what my dumb brain could not.
@a88pockets
@a88pockets Жыл бұрын
Thanks for the video. Between your tutorials and Dors' channel I'm really starting to get this stuff. In fact I had created the bones of a program before digging into your tutorial with 3 functions calls for int letters, int words, int sentences...from these functions: int numLetters(string text); int numWords(string text); & int numSentence(string text); and after watching and completing the tutorial your way with every thing calculated under the main function and then I completed it my way with 3 functions. Longer than necessary but I was pretty pumped that I understood the material enough to solve in another fashion.
@brandongreen5790
@brandongreen5790 Жыл бұрын
Errors in your code: @ 7:18. You would have to change the ">" and "=" and "
@salmasameh5071
@salmasameh5071 2 жыл бұрын
Really thank you for your effort , you are helping me a lot to understand these problems, keep going you are awesome
@LilDrummaDude
@LilDrummaDude 8 ай бұрын
You are a legend my friend!
@karimal-mufakkir4041
@karimal-mufakkir4041 11 ай бұрын
Man, you are an angel ❤
@stuff9893
@stuff9893 2 ай бұрын
Thank you, man! Really helpful
@jerrianbrooks2659
@jerrianbrooks2659 2 жыл бұрын
Definitely subscribed...you have been a lifesaver through this course!!!!!
@Damonbodine
@Damonbodine Жыл бұрын
Super appreciate this video. Thank you.
@clevebissoon2354
@clevebissoon2354 2 жыл бұрын
Excellent stuff mate. None better than you.
@ChonpsScene
@ChonpsScene Жыл бұрын
Hey man, thanks a lot. I did part of the code correctly, but when I start doing the math count the program doesn't want to work, but with this video you give me a light.
@matiasroj0
@matiasroj0 2 жыл бұрын
thank you very much, i love the way you use logic to solve these problems
@NaturesTide
@NaturesTide Жыл бұрын
Your great at explaining things. Thanks a lot for taking your time to make this video.
@36547
@36547 2 жыл бұрын
wonder why he stopped making these? hopefully they didn't tell him to stop posting. He provides this in a very logic way for people
@CS50MadeEasy
@CS50MadeEasy 2 жыл бұрын
Just been really busy, I'll try to start uploading consistently soon :)
@aliyusuf7959
@aliyusuf7959 Жыл бұрын
Thanks for making this video bro. Helped me out a lot !
@dustinhxc
@dustinhxc 2 жыл бұрын
Thank you so much for your explanations! Love your Logic!
@shahriyarm663
@shahriyarm663 2 жыл бұрын
One the handsome and good indian man I've ever seen 🔥♥️ Your explanation is good too!
@becs_forlife
@becs_forlife 7 ай бұрын
A week hitting my head into the wall trying to code this thing 😂😂😂😂 thank u 💞
@sergeantargentmrg3155
@sergeantargentmrg3155 Жыл бұрын
At 8:54 you need to do >= &
@penadine
@penadine 2 жыл бұрын
Thank you, the clever boy! I love you!
@quentinnilsen5356
@quentinnilsen5356 3 жыл бұрын
Great thoughts on this task! Please keep going🙏🏻🙏🏻
@1d_4e32
@1d_4e32 Жыл бұрын
thank you so much man!!!
@esraashahien3467
@esraashahien3467 2 жыл бұрын
The casting part was very helpful thank you :)
@darthayala3832
@darthayala3832 2 жыл бұрын
"I'm going to post videos every single week" disappears for a month. WE NEED YOU BRO!
@CS50MadeEasy
@CS50MadeEasy 2 жыл бұрын
Caesar coming today! :)
@fiow4972
@fiow4972 2 жыл бұрын
wow even iam not understand english buti really understand everything : ) ty bro
@lawimms2154
@lawimms2154 3 жыл бұрын
Thank you SO MUCH!
@CS50MadeEasy
@CS50MadeEasy 3 жыл бұрын
You're welcome!
@YashPatel-xq5bh
@YashPatel-xq5bh Жыл бұрын
Hey , Can you tell me where you get the problem discription / specifications of problem doc file ? Or can you share the these doc files of problem sets .
@Music-Books
@Music-Books Жыл бұрын
Just a quick question about how you were doing the ASCII evaluation prior to replacing all that with the isalpha function. Why wouldn't the evaluation be '> 64' and '< 123' to make sure that the letters A and Z were included?
@kareemziada6554
@kareemziada6554 3 жыл бұрын
Amazing job u do really All love ❤️🙏🏻
@andresvillalba2012
@andresvillalba2012 Жыл бұрын
Thx for step to step, I mean thank you for time
@AlejandroDeLaRosa05
@AlejandroDeLaRosa05 2 жыл бұрын
Thank you so much for all your content!
@MarySkywalker9
@MarySkywalker9 2 жыл бұрын
Thank you! Your explanation was very helpful
@artembelov5997
@artembelov5997 2 жыл бұрын
The problem of counting spaces is that if there punctuation marks like hyphen it will count it as a word. For example: "strlen - calculate the length of a string." Your program will give the answer 8.
@rumibhakar
@rumibhakar Жыл бұрын
thats why i just changed my value to 1 idk i tried a lot to fix it but this was the only solution that came to my mind
@zelimss
@zelimss Жыл бұрын
Thank you man!
@GilVanDerGraaf
@GilVanDerGraaf 2 жыл бұрын
What a great video. Thanks a lot.
@ashmitmishra
@ashmitmishra 3 жыл бұрын
Brother olease continue this series.
@CS50MadeEasy
@CS50MadeEasy 3 жыл бұрын
That's the plan!
@alicjakopinska334
@alicjakopinska334 2 жыл бұрын
@@CS50MadeEasy why did you lie!! We need you
@A-Karim2003
@A-Karim2003 5 ай бұрын
by the way, you dont need to know the ascii value of any letter when checking, Your loop could look like this: if ((text[i] >= 'A' && text[i] = 'a' && text[i]
@guilhos7822
@guilhos7822 9 ай бұрын
I don't understand why they put exercises without arrays on a module/section called ARRAYS. I wasted prob 3 hours thinking about this exercise using arrays, calculating de average of letters in 100 words and stuff like this, to just come here and see how easy is this. Thank you, brother
@Combatereak
@Combatereak 4 ай бұрын
It’s because you’re using the other half of the lecture, where you manipulate strings like they’re arrays. You don’t explicitly need to create an array for this like you do with scrabble
@ahmedsanosy1354
@ahmedsanosy1354 2 жыл бұрын
bro ur genios
@AcerSwizz
@AcerSwizz 2 жыл бұрын
bro u are so smart, just the way u approach the problem makes me feel dumb. I was using the is alpha and isspace function setting the initial word count to 1.
@dsmode
@dsmode 7 ай бұрын
Thank you so much!!!
@donbotanello
@donbotanello Жыл бұрын
Thank you sensei
@moeketsimchunu4833
@moeketsimchunu4833 2 жыл бұрын
I'm from south africa thanks for you help, you simplified everything from pset1 . i salute you
@oluwatunmiseesther8832
@oluwatunmiseesther8832 2 жыл бұрын
You are the best Thank you
@ChristopherCalderonChrisCalder
@ChristopherCalderonChrisCalder Жыл бұрын
Thank you, I didn't think about initializing the word count to 1 instead of 0 and it wasn't working for me.
@josephdaly2041
@josephdaly2041 3 ай бұрын
When you do the loops around the 8 minute mark, aren't you excluding z and Z by not including a "
@nemanjam6272
@nemanjam6272 3 жыл бұрын
Thank you for great work! Can you please explain how to implement this as a function "count_letters"?
@Vladimir-ey7to
@Vladimir-ey7to 2 жыл бұрын
In case someone else needs the answer: create a prototype function int count_letters(string text); and put it before int main(void). Type the same thing, but without the ";" after int main(void), put a pair of those { } and inside of them "explain" what the function does (how it counts letters), by using the technique shown in the video. just remember to use return letters; before the final }. The final step is to tell int main(void) to use the function and count the number of letters, for example letters = count_letters(text);
@emmanuelayisi1492
@emmanuelayisi1492 2 жыл бұрын
int count_letters(string letters) { int letter_count = 0; for (int i = 0; i < strlen(letters); i++) { if (letters[i] != ' ' && isalpha(letters[i])) { letter_count++; } } return letter_count; }
@nicholasmoleta2595
@nicholasmoleta2595 2 жыл бұрын
Thanks for the content. You explain things super clearly
@yotayworldtv
@yotayworldtv Жыл бұрын
Thanks so much
@YashPatel-xq5bh
@YashPatel-xq5bh Жыл бұрын
Thanks Your videos help a lot 👍(scratch game video helps in start point ).
@hadou5483
@hadou5483 2 жыл бұрын
thank you!!
@RASELX
@RASELX 9 ай бұрын
Bro can we use chat gpt for help or even copy some the code? Will they knows?
@brandongiordano7923
@brandongiordano7923 2 жыл бұрын
What's the purpose of the two equals signs on line 22?
@SirRunningwolf
@SirRunningwolf 2 жыл бұрын
Good lesson)!
@doragondsu3587
@doragondsu3587 2 жыл бұрын
i feel soo dumb rn....i was using "=" insted of "==" and......thats it i fell sooo fucking dumb lmaooo greatings from brazil really helped man
@Music-Books
@Music-Books Жыл бұрын
for the float L and float S calculations ..... are we assuming that the division is going to always happen first because of the temporary float status of the variables letters and sentences? Or does it really matter? Thx.
@kartikyadav5704
@kartikyadav5704 2 жыл бұрын
How are you able to figure out all these and present them in such an easy way? Though, Hats Off to you...
@mahdiardforosh6735
@mahdiardforosh6735 2 жыл бұрын
HI,when you are going to upload th other problem sets ?
@heileychan4910
@heileychan4910 Жыл бұрын
Thank you very much for a video! I have a quick question thou: for line 27, can I represent the punctuations(. ! ?) using their ASCII values(33, 46, 63)? Thanks!
@hassanabdel-twab7375
@hassanabdel-twab7375 Жыл бұрын
yes, you can. i used their ASCII values and it worked.
@heileychan4910
@heileychan4910 Жыл бұрын
@@hassanabdel-twab7375 thanks a lot!
@a-creations3758
@a-creations3758 2 жыл бұрын
I wrote it and it compiles and everything but when I try a sentence it says segmentation fault (core dumped)
@yskthegamer9033
@yskthegamer9033 2 жыл бұрын
We're you able to fix it ?
@karimashraf-mb5wb
@karimashraf-mb5wb 2 жыл бұрын
thanks i make the functions and all thing but did something wrong as you when i enter integer into float without casting and when i was debuging every thing right in the equation but the result was wrong untill i make casting to the integer so thank u
@rebecasantamariavillar9116
@rebecasantamariavillar9116 2 жыл бұрын
thank you!!!!
@DEEPTSHOP
@DEEPTSHOP 2 жыл бұрын
There was actually an error. Should be: if ( index > 15) or if ( index >= 16)
@anonymousani5052
@anonymousani5052 Жыл бұрын
when i use (float) in both words, the values get rounded down, so the grade stays lower than it shoulda
@Danielsan1223
@Danielsan1223 Жыл бұрын
I'm pretty sure I wrote everything you wrote, but when I have the results print out like "Before Grade 1" it prints out that phrase several times. Why is it doing this? I've tried and tried to get it to just print the results one time but it won't do that for some reason.
@stora_simon6386
@stora_simon6386 2 жыл бұрын
MAN I FKN LOVE YOU, iDK IF IM RETARDED BUT I WOULD NOT BE ABLE TO SUBMIT ANY OF THESE CODES WITHOUT YOU. THX (=
@maishamohomed3076
@maishamohomed3076 Жыл бұрын
can you tell me why in the loop text has () brackets and in the isalpha text[ i ] has a square bracket?
@Syneptic
@Syneptic 2 жыл бұрын
Doesn't work.
@RuthYu.63
@RuthYu.63 Жыл бұрын
Hi, I am Ruth! Thank you for your video. I have a question regarding definiting letters. I tried both the "c language" way and the "isalpha" function but the results were different. When using the "isalpha" function the grade is correct. However when I use the original way the grade is always 3 grades less than expected. Do you have any idea why this happens? Thank you!
@rebekahmenn2118
@rebekahmenn2118 2 жыл бұрын
Quick question (I hope this makes sense): at the very end of the code where we have the "if (index < 1).... else if (index >16) ... else..." When I was creating my code, I initially made two "if" statements: "if (index < 1) ... if (index > 16)... else..." I didn't use "if" "if else" "else." And for some reason, when I use the code "if (index > 16)... that affect my output for sentences below grade one. It would tell me "Before Grade 1. Grade -7." I'm curious why changing the "if else" statement which corresponds to levels ABOVE grade 16 would affect the output for levels BELOW grade 1. I checked several different sentence levels using "if" "if" "else" (instead of the proper "if" "if else" "else") and it only affected the results for below grade 1. Any insight would be greatly appreciated. Thank you for this video! I found it incredibly helpful!
@moa9640
@moa9640 2 жыл бұрын
i had this same issue, the second if is not "if else", it's "else if" that fixed mine
@MorphTW
@MorphTW 2 жыл бұрын
It seems like i have a rounding problem. i pass around 50% tests and fail the others with 1 grade difference.
@VDViktor
@VDViktor 2 жыл бұрын
Everything here is done in main. In CS50 manual all three functions are declared separately, and as i try to code them each separately - it all gets messed up for some reason.
@CS50MadeEasy
@CS50MadeEasy 2 жыл бұрын
There's more than one way to solve the problem sets. I did it the way I found to be the most understandable. You can choose to do it with functions as well if you'd like. :)
@siaralamex
@siaralamex 2 жыл бұрын
did you try do step by step? I just found the way to print the number of letters, we'll se if I am able to solve the rest ;)
@mathewmphilip9775
@mathewmphilip9775 2 жыл бұрын
I am getting segmentation fault (core dumped) when doing count_sentences...could anyone help
@yskthegamer9033
@yskthegamer9033 2 жыл бұрын
We're you able to fix it ?
@maxim5519
@maxim5519 2 жыл бұрын
if I understand right for grade 16 + and 16 itself code supposed to be like this (more or equal): else if (index >= 16) { printf("Grade 16+ "); } not just (more): else if (index > 16)
@jamesolgen
@jamesolgen Жыл бұрын
youre crazy man, you code on light mode, ahahhahahahhaha, great tutorial, thanks
@davidwds
@davidwds 2 жыл бұрын
thanks man!\
@Rohit4792
@Rohit4792 2 жыл бұрын
hello friend ?? can you tell me if this program also works on iPhone 7 Plus with iOS 15.4 ??
@Allin1Xavi
@Allin1Xavi 2 жыл бұрын
What would change if float index is implemented instead of int index? What’s the difference? Wouldn’t that be better since we need to round to a whole number to calculate a grade level? Or is the calculation itself a decimal and we just ask the program to print a whole number, unless the value is less than 1? I just want to be sure I’m right and not try to overthink it bc I’m still fairly new to this.
@15emranlutfi9
@15emranlutfi9 Жыл бұрын
when you add for example 1.4 + 1.3 = 2.7 , it will round up to 3. However, if you add them as integers you will get 1+1 =2.
CS50 Problem Set 2 - Caesar (Step by Step Walkthrough for Beginners)
25:50
CS50 Made Easy with Rahul
Рет қаралды 83 М.
CS50 Problem Set 1 - Mario Walkthrough (Step by Step for Beginners)
18:23
CS50 Made Easy with Rahul
Рет қаралды 247 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
CS50 Problem Set 3 - Plurality Solution (Step by Step Walkthrough for Beginners)
22:32
CS50 Lab 2 - Scrabble Walkthrough (Step by Step Walkthrough for Beginners)
23:29
CS50 Made Easy with Rahul
Рет қаралды 69 М.
CS50 Problem Set 1 - Cash Solution 2023 Update (Step by Step Walkthrough for Beginners)
15:00
(CS50) CREDIT - PROBLEM SET 1 | SOLUTION
37:16
Dors Coding School
Рет қаралды 37 М.
CS50 - BOTTOMUP AND LICENSE:  PRACTICE PROBLEMS WEEK 4 | SOLUTIONS 2023
19:55
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 3,6 МЛН
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 836 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН