CSC 160 : Introduction to Computer Programming for non-majors

Pepper Home CSC160 Home Syllabus Assignments Notes Exercises Alice BlueJ Contact Pepper

Date Due Assignment name Description
9/2/09

knock-knock jokes

& Have finished reading Chapter 1

In groups of 2: Chap 1 exercise 1.2 - Using any two characters from the Alice Gallery, design and build a world in which one tells the other a knock-knock joke. Include your own name in the conversation (ex: Hi Kris Pepper, Who's There?). Make your story end with both characters laughing. See www.knock-knock-joke.com for ideas if you need.
9/9/09

Have finished reading Chapter 2

HW 2 Instructions

9/14/09 Have finished reading Chapter 3

Switch roles: Write a story (or continue last story) including:

  • 2 scenes
  • 2 characters each with
    • 1 method (something it does - no return) that uses a variable
    • 1 function (something it does - with a return)
      • Examples:
        • to ask the user their first name and last name and return the full name.
        • to add 50 to a number (parameter in) and then divide that result by 2
        • to zoom into another object (that other object is a parameter) and return the distance to it minus 1.
    • Either the method or the function needs to use a parameter.
9/16/09   Have finished reading chapter 1, 2 & 3

Each person should add 1 askMyName method to 1 character in your prior movie. That method should ask the user for the character's name and then say, My Name is <whatever the user said the name was>. It should also ask the user for the character's favorite number and then the character should say, My favorite number is <whatever number the user entered>.

(To do this, you will have to read chapters 2 and 3 to remind yourself how to convert numbers to strings and how to ask the user for information. You will need a variable to hold the answer from the user, so that you can pass the answer on to the next statement. You will need to use the world's ask user "number dialog" and "string dialog" functions. )

When the methods have been added, please have your movie call the new methods in the beginning of your movie.

You can either pass the world back and forth between teammates, or save a character as an object, add the new method and then import that character back into the movie knowing the new method.

Note: I ran into a problem creating string variables in the lab. If you have that problem at home, please email me.

9/21/09   Note: This one is not being graded separately. The grade on 9/23 will include this work.

Have finished reading chapter 1, 2 & 3

Each person should add 2 methods to any one character.

1) a whoAmI function that will ask the user for his first name and last name and return the full name.

2) a sayHello method that accepts a name parameter and will say "My name is " and the name parameter and "It have a movie for you."

3) a sayGoodbye method that accepts a name parameter and will say "This is " and the name parameter and " signing off now. Goodbye."

When the methods have been added, please upload your character to the discussion board.

Then, one person can create a movie with these characters. Create a variable for each character's name. Then it should ask the user to name the characters (meaning set variable to the whoAmI function). Then, it should call the sayHello method on each character, passing in their name. At the end of the movie, each character should sayGoodbye.

Only one person needs to upload. Please name the world file with both people's names. ex: kris_pepper_and_mary_smith.a2w

9/23/09   Have finished reading chapter 1, 2 & 3 & 7

Each team member should change their whoAmI function to store the character's name into new property variables of first name and last name. (The function should still return the full name, even though the calling method wont need it anymore.) They should also change the sayHello and sayGoodbye methods to use the character's first and last name property variables instead of the parameter. Remove the parameter of name from these methods.

When the methods have been added, please upload your character to the discussion board.

Then, one person can change the movie to use with these updated characters with their updated whoAmI, sayHello and sayGoodbye functions and methods.

Only one person needs to upload. Please name the world file with both people's names. ex: kris_pepper_and_mary_smith.a2w

9/30/09   Write a program in Java to print out 2 lines. Each team member will write a user story for the other team member. The other team member will write the program. The master programmer will put the two programs together so the first story runs and then the second one runs. Remember to use the HELP board if you have trouble. Instructions for downloading BLUEJ are in the syllabus.

Here are the BlueJ download instructions plus videos of me doing this assignment.

Here are the steps:

1) Write a story that describes what the user should see when they run this program. It is just 2 lines the program should print. (You should have finished this in class.)

2) Give your story to your partner by replying to your names on the moodle discussion board.

3) Design and code your partner's story. (Each person will code their teammate's story.) If you are the master programmer, please create your class name as the names of the team members.

4) Test your own program

5) Give the finished program to the master programmer for this assignment (and this position should rotate for the next assignment). Copy and paste all your code into a reply on the discussion board.

6) The master programmer will merge the two: Please copy the code from your own class first and then copy the code inside your main class to the bottom so that the program will first run your one story and then the next.

7) Master programmer will upload the java file or copy the code into notepad and upload the txt file. (Please don't use Word, though I will accept it if you cannot find notepad or the java file.)

10/5/09   Write a program in Java to solve a numerical problem. Each team member will write a user story for the other team member. The other team member will write the program. The master programmer will put the two programs together so the first story runs and then the second one runs. The test data for both stories needs to be in the comments. Remember to use the HELP board if you have trouble. Instructions for downloading BLUEJ are in the syllabus.

Here are the steps:

1) Decide upon a problem that can be solved by asking the user for a couple numbers, doing a calculation and printing a result. (You can look at 7.4 - 7.12 for ideas.)

2) Write a story that describes what the user should see when they run this program. (See user story on page 211 or in powerpoint for an example.)

3) Give your story to your partner by replying to the discussion board entry under your group.

4) Design and code your partner's story. (Each person will code their teammate's story.) Please put your own name after each variable, so instead of dollars, you would create dollarsKrisPepper. If you are the master programmer, please create your class name as the names of the team members.

5) Type your test data into the comments.

6) Test your own program

7) Give the finished program to the master programmer for this assignment (and this position should rotate for the next assignment). Copy and paste all your code into a reply on the discussion board.

8) The master programmer will merge the two: Please copy the code from his own class first and then copy the code inside your main class to the bottom so that the program will first run your one story and then the next. Please also copy the comments containing the test data into the top of the program. (You will need to remove your partner's creation of the scanner if it has the same name as yours. If variable names are the same in both stories, you will need to change the names.)

Please upload just the .java file into this assignment.

10/7/09   Study for Quiz and Use Codelab. See instructions here:
10/21/09

Study for midterm and do Codelab See guide here.
11/30/09  

Study for loop and decision quiz. See guide here

To help study: A program to trace: A paper to trace onto The solution         



Another study help: A smaller program to trace  A paper to trace onto
    Prep for final