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 : When we enter a numerical grade, for example, 89123, do we really mean 89,
when we enter 12345, we really mean 12?
What does it mean when we enter 987? Enter 27? And 6?


Q8 :When we use setw(), is there a way to make the output left justified? By default, it is right justified.


Q9 :How do I output the '+' or '-' sign on the same line as the letter gradewhen I use the second switch statement.


Q10: Is it acceptable for us to write a seperate function that gives the grades their +/- extensions, and then just call it from within the if else and switch statements?


Q11 : Is this the correct off-campus email address for questions on PA?


Q12: If a 0 or alpha. letter is input it loops endlessly, how can I fix it?


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: When we enter a numerical grade, for example, 89123, do we really mean 89, when we enter 12345, we really mean 12?
What does it mean when we enter 987? Enter 27? And 6?

A7: If input is: 89123 want to convert: 89 to B+
If input is: 12345 want to convert: 12 to :(
If input is: 987 want to convert: 98 to A+
If input is: 27 want to convert: 27 to :(
If input is: 6 want to convert: 6 to :(

The assignment states the when the numeric grade is in the range of 0-100 then we convert to a letter grade.
Essentially, when the numeric grade is greater than 100, keep reducing (dividing by zero).


Q8: When we use setw(), is there a way to make the output left justified? By default, it is right justified.

A8: Here's one way:
cout << setiosflags(ios::left) << setw(5) << num1;
<< resetiosflags(ios::left) << setw(5) << num2;
Prints num 1 in 5 columns wide left justified then num2 in 5 columns wide right justified after resetting the flag.



Q9: How do I output the '+' or '-' sign on the same line as the letter grade when I use the second switch statement.

A9: Do not add a "\n" to the cout after displaying the letter grade
cout << letter;
....
cout << symbol << "/n";



Q10: Is it acceptable for us to write a seperate function that gives the grades their +/- extensions, and then just call it from within the if else and switch statements?

A10: NO functions yet! Do not use constructs we have not talked about.
Therefore just put this function code right within the if statement.
Then also put this function code within the switch statement.


Q11: Is this the correct off-campus email address for questions on PA?

A11: Use this email address. I check it 5 times a day. Unfortunately, communications/network was down on Sunday.
You can also email the Proctors by sending: mail cs9u@ieng9.ucsd.edu


Q12: If a 0 or alpha. letter is input it loops endlessly, how can I fix it?

A12: PA#1 states that one integer in the range of 0 to 4294967295 will be input by the autograder. So don't worry about the alphabetical letter.

BUT you must check for the zero input using the while loop.
initialize input to a value to enter while loop

while ( not zero )
{
cout << "Enter number: ";
cin >> input;
if ( input is zero )
cout << "Err";
}


TOP


Home || Course Description || Course Outline || Labhours || FAQ


Webmaster: Nilofer Motiwala

Last updated July 7 1997