You are to submit your programs to Gradebot before uploading them to SmartSite. Gradebot will grade their correctness. What follows assumes that you have your Gradebot keys set up properly; if not, see the handout All About Homework to learn how to do this.
Problem 6 asks you to write a program that computes the Fibonacci numbers in two ways, recursively and iteratively; the interface is documents in the assignment.
To help you, we have placed a reference executable in the file /home/bishop/ecs30/reffibs in the CSIF. It is the one Gradebot uses to evaluate your program (noting, of course, that the Gradebot times may be different than yours) There is also a file containing precompiled timing routines, /home/bishop/ecs30/timeit.o, that is the same as the one Gradebot links to your function. You should use that to do the timings. The example file /home/bishop/ecs30/timeex.c is a small program that uses the functions; you can use that to see how to call them.
The easiest way to do this assignment is to simply write your function in a file named “fibs.c”, put the “timeit.o” file in the same directory, and type:
gcc -ansi -pedantic -Wall -o fibs fibs.c timeit.oNow you have a program that will time the iterative and recursive versions — assuming your program calls the functions correctly.
First, log into the CSIF. (You can do this on your laptop, but the steps may work differently.) Next, go to where you want the work area directory to be. Then type:
git clone firstname.lastname@example.org:user/your_ucd_email/1/5where your_ucd_email is your UC Davis email, with the “@ucdavis.edu” deleted. Note the “5” at the end of the command; as this problem has ID 5, you need to get the corresponding work area. For example, my UC Davis email is “email@example.com”, so I would type:
git clone firstname.lastname@example.org:user/mabishop/1/5to create my Gradebot work area. That area is now in the directory named “5”.
When you want to submit your function for grading, copy it into the directory “5”. You should not submit “timeit.o”. (If you do, Gradebot will ignore it, so no harm done.) Gradebot has the same file, and uses its copy to compile the program.
Once you have “fibs.c” in the directory “5”, go to that directory and type the following commands:
git add fibs.c
git commit -m ’change message’
git push origin master
The first command informs git that you have added a (new or changed) file to the repository.
The second command adds a change message, which is a very brief description of what you changed. Remember to put the single quotation marks around the message, or it will not work right (and give you very mysterious error messages! For this step, if you prefer to use the vim(1) editor to enter your comment, say instead:
git commit -aand the editor will come up.
The third command actually pushes your file over to Gradebot, which will promptly run it. It may take a minute or two, especially if a lot of people are using Gradebot at the time, so look at the “Submissions being graded” and “Submissions to be graded” part of the Gradebot window.
Once you have finished the programs and are happy with the results, you have to submit the files to the homework area in SmartSite. You can do this by physically going to the CSIF and uploading them there. Or, you can transfer them to your laptop or home computer and upload them from there. If you do the latter, watch out for character conversion problems. The ASCII printing characters will be transferred correctly, except for the end of line marker; this may be changed to a carriage return, a line feed, or some combination of the two. But if you have non-ASCII characters such as any accented letters, emoticons, or non-Latin letters, those will probably not transfer correctly.
If you have trouble getting Gradebot to run your program, but have done so successfully before, then the problem is almost certainly not your key. Try the following steps.
First, be sure you are looking at the current version of the Gradebot page. Gradebot does not send updates to your browser; you have to pull them over. So try refreshing the window in your browser. Check the time when you submitted your last version. If Gradebot didn’t run your program, then go on to the next step.
Next, be sure you have set up your work area and you execute the three git commands from within that directory. It’s very common to forget the first or second command, or to execute the commands in the parent directory, and in these cases the program won’t get sent over to Gradebot.
Third, be sure you are executing the git commands from the work area. If you see an error like:<br>
If none of these are it, here are a couple of other things to check.
make: *** No rule to make target ‘fibs’. Stop.
|You can also obtain a PDF version of this.||Version of November 13, 2015 at 11:14PM|