A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 4 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/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/pset1a.pdf

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    The 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.

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.