Problem Solving Assignment 2



Due Monday, January 22 at 11:59pm PST


There are two problems in this PSA.

Notes:


This homework requires skills from Chapter 1 and Chapter 2.


Problem 1

Make a vending machine change calculator:


Problem 2

Make a MadLib generator.

Introduction:

Specifics:


Details

Making your psa2 directory

Start by creating a directory (folder) in your ieng6 cs8fzz account (this is necessary for the bundle-psa2 script). After you log in, create a directory by typing the commands:
-bash-2.05b$ mkdir psa2
Go into that directory (like double clicking to open a folder) with the command:

-bash-2.05b$ cd psa2 
Note: you must name your directories (folders) and files as indicated in the problem descriptions for the turn in program to work.

Getting your MadLib starter code

-bash-2.05b$ cp ~/../public/MadLib.java ~/psa2
Note that your psa2 directory has to be made already.

Running the sample solution program

In order to run the sample solution program you should invoke the following command:
-bash-2.05b$ runsample [classname]
So for this assignment, do:
-bash-2.05b$ runsample ChangeMaker
or
-bash-2.05b$ runsample MadLib

New! 1/18 10pm: Grading Criteria

This assignment is worth 20 points.

How to turn in your homework electronically

When you are ready to turn in your homework, run bundle-psa2 from your psa2 directory. The session should look like this:

-bash-2.05b$ cd ~/psa2
-bash-2.05b$ bundle-psa2
Good; all required files are present:

        ChangeMaker.java
        MadLib.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/cs8w/turnin.dest/cs8wzz.psa2
.
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-psa2 again. The program will warn you that a "previously turned-in file exists" and ask if "you wish to over-write this existing file" (delete the old version and replace it with this new one). Respond in the affirmative by typing y and pressing the Enter key.

Getting Your Interview Done

10% of your grade on this assignment will come from an interview you will have with one of the tutors during Open Lab Hours. You have 48 weekday hours after the electronic turnin deadline to get your interview done. The deadline for the interview for PSA 2 is Wednesday, Jan 23, theoretically at midnight, but actually by the end of the last tutor hour scheduled. You get an interview by going into B260 during a scheduled tutor hour. Find the tutor, ask them if you can interview for PSA 2. 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 (psa4) 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. 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.

Note: Copying the assignment directory to partner's home directory.
You can copy the psa2 directory and its files to your partner's home directory by:

bash% scp -r psa2 cs8wxx@ieng6.ucsd.edu:

(don't forget the colon at the end of the command) where cs8wxx is your partner's username. Your partner is required to enter his password.

Learning to use text editors

Vim

Run the command vimtutor, a separate program that will teach you to use Vim.

Emacs

Use the built-in tutorial by running emacs and, within the editor, typing CTRL-h t.

Pico

You can reach Pico's built-in help by typing CTRL-g. If you want further instruction, look at this Pico tutorial from NC State.