Create a second file, a text file, called answers.txt. You will submit answers to each small coding step below into this file. Separate your answers with a line like this:
Step x. -------- <the current time> ----------------- your code here sample output from running your codePlease put the current clock time into the header for each step, so that I (your professor) can see how long each step takes you.
In main(), write assert statements to test that your
funcion is correct in all cases.
Add a line like cout << "All tests passed!\n" after your assert statements.
Submit your code when you have it working correctly, labeling the submission as "Step 1. --------- <the current time> -------------------------------"
Move your constrain() function to utils.cpp and a write a prototype of
the function in utils.h.
Include utils.h in main.cpp.
Compile your project and make sure everything works OK.
Now, make the default values for constrains() low parameter be 0.0,
and the high parameter be 100.0.
Add more assert "tests" to your main code to make sure these default arguments
work correctly.
When you have your code completed (and perfectly indented!), copy and paste your code from all files into answers.txt.
for each integer "divisor" value from 2 through n / 2, if you divide the number by that divisor, and the remainder is 0, that number is not prime -- return false. if you get through all possible divisors, the number is prime: return true.
/home/cs/112/current/yourUserId/proj1Any code in the file should be indented correctly, as if it were in a .cpp file.
More info...
The directory /home/cs/112/current should contain a directory with your user-name. You can check by typing this command into a terminal window:
$ ls /home/cs/112/currentEach week's lab and project must be (separately) copied to your directory, so that the grader can grade it. If your lab is not copied to your directory within /home/cs/112/current, the grader will not be able to find it, and you will receive a zero!
To illustrate, suppose that your user-name is abc1, that you are currently in your home folder, that your Eclipse workspace is named cs112, that your cs112 folder is within your home folder, and that your lab01 folder is inside your cs112 folder (i.e., /home/abc1/cs112/proj1). Then you should enter:
$ cd cs112
to change directory to your workspace -- the folder "above" your proj1 folder. Then enter:
$ lsto view the contents of your workspace. At this point, you should see folders for last week's lab (lab0) and this week's lab (lab1). Then enter:
$ cp -r lab1 /home/cs/112/current/abc1
where you replace abc1 with your user-name. The cp -r command will recursively copy lab1 and all of its subfolders into your folder inside /home/cs/112/current/. You can check that this worked by listing the contents of your folder:
$ ls /home/cs/112/current/abc1
lab01
and then verifying that your folder contains a copy of the today's files:
$ ls /home/cs/112/current/abc1/lab01 ... files for lab01 should appear ...
We will be using these same commands to submit our labs and projects each week for the rest of the semester, so you should record them somewhere that you can easily find them (or maybe bookmark this page).
When your folder within current contains a copy of your lab work, you are all done. Congratulations!
Next, you should email all your files to your partner, so that she/he can work independently on the project.