CSE 9B FAQ

Q1: How do I compile our assignments at home on our PC's then transfer it over? Q2: When I turnin Assignment #1, the program asks if I want to
overwrite Assignment #0. Should I do this? Q3: When we turn in the executable, does the file need to be named a.out? Q4: When I enter large numbers such as 9876598765 into my solution
for Assignment #1, I get strange results. Why is this? Q5: On Assignment 0 I forgot to type in the header with my login name,
can I retrieve the program because I already turned it in using turnin -c cs9u p0.C? Q6: When I compile, I get a bad magic number error, what's wrong? Q7: Is it ok if I change: void prt_time (void); //given in assignment
to: void prt_time (Time , Time);



Q1: How do I compile our assignments at home on our PC's then transfer it over? A1: In order to compile programs on your computer at home, you need to have a C++ compiler installed on your PC. If you have one, then the instructions that come with the compiler will tell you how to compile. After you have the program working on your PC, you can then transfer the source file from your PC to your Unix account. There are several ways to do this. One way is to save it onto a floppy disk and take it to the basement of AP&M where one of the "zebras" can show you how to ftp (or put it using fetch, if your computer is a Macintosh) it to your Unix account. If you purchased the Intenet software from UCSD for your home computer, you have a program called WS-FTP (Windows) or Fetch (Mac). This ftp program will allow you to transfer files from home to your class account. Both of these programs are available freely on the Internet. Also, Windows (95/NT) has a command line ftp, but the previous programs are much simpler. Since you said that you have Eudora on your PC, you should be able to just send the source file as a message or an attachment. Refer to the Eudora instructions for details. After this is done, you can save the message or attachment from the mail program on your Unix account. If you are saving it as a message, do not forget to remove the mail header info. There are two possible ways you can transfer a file using a terminal program. One way is to use a file transfer protocol. Kermit is the only one I noticed that is available on the class accounts, there might be others. You need to look at the documentation for the terminal program on your PC and the man or help pages for kermit on your Unix account. Again, the zebras should be able to help you sort through this info. Also, many terminal programs allow you to insert a text (or ASCII) file instead of typing. If this is the case, you can open vi and set it in the insert mode, then insert the text file using the command on your terminal program. You can then press 'esc' and write it to a file as if you typed it in manually. No matter which method you try, there are a couple of important points to remember: 1. Make sure that after you have transferred the file that you change the name of the file (using mv) so that it has the .C extension. 2. As there are no expressed or implied warranties for any of these methods, experiment with and establish a couple of alternate stable methods early. This is important in case one of the methods is not available when you need to "upload" your file(s). Under no circumstances should you experiment just before a project is due, there will no deadline extension if either one or all of these methods don't work. It is much better to finish early enough that you can come into the computer lab, type in your program, and test it if you need to. If you don't have a compiler and have a PC, modem, terminal program, and dialin account, you can work on your class account from home. After dialing in and entering your dialin user name and password, you can telnet to your class account. Be aware that if you have time restrictions on your dialin, they will also apply in this case. Similarly, if you have access to another Unix account, you probably can telnet into and use your class account from that account. There are man and help pages available for telnet. Your best sources of information are the documentation, the zebras, Network Operations, and me (TA/Proctors).
Q2: When I turnin Assignment #1, the program asks if I want to overwrite Assignment #0. Should I do this? A2: The program that you turned in Wednesday was just practice. Go ahead and turnin Assignment #1 whenever you want. We will collect #1 on the 5th, so don't turnin #2 until after that.
Q3: When we turn in the executable, does the file need to be named a.out? A3: When you use the turnin program, you should turnin your .C file only, not the executable. When we grade your program, we will compile the source code that you have written. The name does not matter, when it is turned in it is given your login name.
Q4: When I enter large numbers such as 9876598765 into my solution for Assignment #1, I get strange results. Why is this? A4: An unsigned long integer can only contain values from 0 to 2^32 - 1. When a number outside of this range, such as your 9876598765, is entered it is interpreted in the valid range. This is known as integral wrapping. For example, the value 2^32, when entered, is actually interpreted by the computer as 0. This is why gigantic numbers are often misinterpreted as relatively small ones.
Q5: On Assignment 0 I forgot to type in the header with my login name, can I retreive the program because I already turned it in using turnin -c cs9u p0.C? A5: The program p0.C created during the lab orientation tour is just an example that will not count for any grade. The program p1.C, in your handout "Programming Assignments" that is due this Saturday, 7/5 at 9am is important. You may "vi p1.C" again and insert that header line to identify the owner. Then use the turnin program as many times as you want until the deadline date: "turnin -c cs9u p1.C"
Q6: When I compile, I get a bad magic number error, what's wrong? A6: This message comes up when you name your file with a little c (pa.c) instead of a big C (pa.C). The little c means a C program, and the big C means a C++ program.
Q7: Is it ok if I change: void prt_time (void); //given in assignment to: void prt_time (Time , Time); A7: No need to change: void Time::prt_time(void); This is invoked in main() as "time1.prt_time();" and "time2.prt_time();" Declaration is: void Time::prt_time(void); This *ONLY* prints the data in the format "08:09:10" and that's it!!! Any other output is printed in main() as user friendly outputl This is important because you will reuse this in PA#2.

HOME || Course Description || Course Outline || Lab Hours || FAQ