Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 Online
OpenStudy (anonymous):

Hi everyone, I couldn't find a way to solve ps1. I've just finished lecture 1 and 2, and I think ps1 due for lecture3. But I'm not sure if the knowledge I have so far is enough to solve ps1. By the way I'm very new with the programming. Do you think, just knowing while and if statement are enough to solve this question. Thanks for your help...

OpenStudy (anonymous):

With while and if statements you could solve all the problems that you can find an algorithm for them (see lecture3) ! Here's the idea, with a loop you can count the primes till the 1000th, and with another loop inside (for incrementing divisors) and with some tests you can check if a candidate is a prime or not. Well I just want to say that your knowledge is largely enough to resolve this problem, good luck ^_^

OpenStudy (anonymous):

another hint: there is no need to test each divisor, the already known list of prime numbers is just enough

OpenStudy (anonymous):

Thanks for your advise, morphy and anpenik. I try my best to solve it, it just feels too complicated. Do you think, I should first watch lecture 3?

OpenStudy (anonymous):

lecture 3 is about developing good style and writing proper codes, you can watch it may be it'll help you. but don't jump to the 4th until you feel at ease with the basics :)

OpenStudy (anonymous):

Thanks for your comment morphy. I did watch the lecture three and it really helped me out, but I'll listen your advise and until I feel comfortable with the exercise, I won't start to the lecture 4.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Breathless: Spooky witch but cute
4 hours ago 3 Replies 0 Medals
Arriyanalol: help
4 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
7 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
7 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!