A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
I have just started the 6.00 course and have watched the first 4 lectures. I have been looking at the 2nd Assignment and I am completely confused. Can anyone help me get started? The assignment is to write some code that will generate the 1000th prime.
http://ocw.mit.edu/courses/electricalengineeringandcomputerscience/600introductiontocomputerscienceandprogrammingfall2008/assignments/pset1a.pdf
anonymous
 5 years ago
I have just started the 6.00 course and have watched the first 4 lectures. I have been looking at the 2nd Assignment and I am completely confused. Can anyone help me get started? The assignment is to write some code that will generate the 1000th prime. http://ocw.mit.edu/courses/electricalengineeringandcomputerscience/600introductiontocomputerscienceandprogrammingfall2008/assignments/pset1a.pdf

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0The key is to break the problem down into steps. Do not worry about finding the 1000th prime number at first. Start by creating code that can accurately test whether a number is prime. To do this you could write code that will take a number from the user and test it. This will require you to assign a variable to a number inputed by the user (This is similar to how you assigned variables in PS0 for first and last names based on user input.). Then create a prime number test that tests whether the number given by the user is prime. Once you achieve a working test for primality, you can begin to think about how to code your program to keep track of how many primes have been found and how to make it stop testing for primes once 1000 have been found.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.