There are two problems in this PSA. Here is the overview. Note, there is an interview process required for this PSA. Details at bottom after turning instructions. This work should be done in it's own directory (psa3). NEW You must include some specific comments with your code. See details below.
This homework requires skills from Chapters 1,2, and 3.
In order to be able to use the turnin script easily, start by creating a directory (folder) in your ieng6 cs8f account. After you log in, create a directory by typing the command (don't type < enter > just hit the key) :
mkdir psa3 < enter >Go into that directory (like double clicking to open a folder) with the command:
cd psa3 < enter >
You MUST name your files as indicated in the problem descriptions for the turnin program to work.
For each coin toss enter either 'h' for heads or 't' for tails.
First toss: h
Second toss: t
Third toss: t
Forth toss: h
Fifth toss: t
Sixth toss: h
Seventh toss: t
Eighth toss: t
Statistics:
-----------
Number of heads: 3
Number of tails: 5
Percent heads of valid inputs : 37.5
Percent tails of valid inputs: 62.5
Notes:
yy copied (yanks) one line. p places that line below the line you are currently on.
For example, the input
Hello there Jose.Should produce the output
I don't understand what you mean by "there Jose."With the quotes. Your program only has to accept one sentence. If your input sentence has only one word, it will print out
I don't understand what you mean by "". You should prompt the use to enter the sentence with an appropriate comment printed out on the screen (for example: Please enter a sentence:)
Notes:
When you are ready to turn in your homework, run bundle-psa3 from your psa1 directory. The session should look like this:
-bash-2.05b$ cd ~/psa3
-bash-2.05b$ bundle-psa3
Good; all required files are present:
SimpleMath.java
ChnageMaker.java
Do you want to go ahead and turnin these files? [y/n]y
OK. Proceeding.
Performing turnin of approx. XXXX bytes
Copying to /home/linux/ieng6/cs8f/turnin.dest/cs8fzz.psa3
.
Done.
Total bytes written: XXXX
Please check to be sure that's reasonable.
Turnin successful.
If you want to make changes after you've turned in your homework, make the changes and run bundle-psa3 again. The program will warn you that a "previously turned-in file exists" and ask if "you wish to over-write this existing file". Respond in the affirmative by typing y and pressing the Enter key.
You get an interview by going into B250 during a scheduled tutor hour. Find the tutor, ask them if you can interview for PSA2. If they have others who are waiting for interviews, your name will go on the end of the list of people waiting. Interviews take about 5 minutes each. It is your responsibility to go in early enough that you can get your interview completed. If everyone waits until the last hour on Wed, this will not work.
The tutor will ask you to log in, change to the directory where your work is (psa3) and then to follow their directions. They will ask you to run your program to show that it works, open files in your favorite editor, and ask you questions about HOW your code works. Additionally, they may question you as to how you would (theoretically) make small changes to the program to have it do something slightly different. You will not actually be required to change your code.
Learning to be able to explain your problem solving process and discuss code with another human being is a very important professional skill. We hope that this process will help you develop this skill.
Learning to use text editors
vimtutor, a separate program that will teach you to use Vim.emacs and, within the editor, typing CTRL-h t.CTRL-g. If you want further instruction, look at this Pico tutorial from NC State. Which editor should I use?
For most of us, the choice of a text editor is a matter of preference (or, more likely, familiarity). It happens that Beth Simon and Dana Dahlstrom use Vim, but many other computer scientists use Emacs. Pico is a simpler editor designed to be easy for beginners. Pico is much less powerful than Emacs or Vim once you learn to use them.