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 function to read an integer; the interface is documents in the assignment.
To help you, we have placed the input for Gradebot in the directory /home/bishop/ecs30/hw3-6-input in the CSIF. There is also a driver, /home/bishop/ecs30/getintdriver.c, that is the same as the one Gradebot uses to link to your function. That driver prints the outputs that Gradebot will use to evaluate your function. Of course, your function should pront nothing.
The easiest way to do this assignment is to simply write your function in a file named “getint.c”, put the “getintdriver.c” file in the same directory, and type:
gcc -ansi -pedantic -Wall -o getint getintdriver.c getint.cNow you have a program with the required interface — assuming your function getint works 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 email@example.com:user/your_ucd_email/1/4where your_ucd_email is your UC Davis email, with the “@ucdavis.edu” deleted. Note the “4” at the end of the command; as this problem has ID 4, you need to get the corresponding work area. For example, my UC Davis email is “firstname.lastname@example.org”, so I would type:
git clone email@example.com:user/mabishop/1/4to create my Gradebot work area. That area is now in the directory named “4”.
When you want to submit your function for grading, copy it into the directory “4”. You should not submit “getintdriver.c”. If you do, Gradebot will ignore it, so no harm done. But Gradebot has the same driver, and uses its copy to compile the program. This means, of course, Gradebot will ignore any changes to “getintdriver.c” that you make, even if you submit it.
Once you have “getint.c” in the directory “4”, go to that directory and type the following commands:
git add getint.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:
fatal: Not a git repository …
this is almost certainly what caused the failure. Find the right working area, change to it, and rerun the command.
If none of these are it, here are a couple of other things to check.
make: *** No rule to make target ‘getint’. Stop.
|You can also obtain a PDF version of this.||Version of November 1, 2015 at 2:23PM|