Business Programming

Course announcements for INFS1609 and INFS2609

Business Programming random header image

13s2 Blog Moved to COMP1400

Posted by on August 9th, 2013 · Announcements

As the INFS1609/INFS2609 courses for 13s2 are fully combined with COMP1400, please go to the COMP1400 Blog. From now on, we will only be updating the COMP1400 web site.

Lab Week 2 – Getting to know BlueJ

Posted by on August 1st, 2013 · Labs

There are three tasks for this week’s lab:

  1. Activate your CSE account.
  2. Write your first program!
  3. Play with BlueJ

Activate your CSE account

The first thing we will do in this week’s lab is activate your CSE account, if you haven’t done so already.

  1. Login as ‘newuser’
  2. Follow the prompts to activate your account.
  3. Write your new username and password somewhere so you don’t lose it.
  4. Log out.
  5. Click on the ‘Session’ button on the login screen.
  6. Select ‘Gnome’.
  7. Login with your new username and password. (Sometimes it can take up to 30mins for your account to be activated. If this is the case, complete the next activity and then come back to this step.)
  8. When asked, click ‘Make Default’.

Write your first program.

Need help with this exercise? Click here.

This is an exercise in breaking down a task into a sequence of simple instructions. Work in pairs. Your tutor will give each of you a small, incomplete pack of cards.

  1. Shuffle the deck.
  2. Go through the deck to find the smallest card.
  3. On a sheet of paper, write a set of instructions so that someone else can repeat the same procedure. Assume that they are very stupid and need to have ever last detail spelled out.
  4. Test your instructions on different size decks:
    • What if there is only 2 cards in the deck? Or only one? Or none?
    • What if all the cards in the deck were the same?
  5. Swap programs with another pair and check their code. Was it the same as yours?
  6. Consider: What are the objects in your program? What are the classes? What fields do they have? What methodsdo they provide?
  7. Now try writing instructions to sort the entire deck into order.

Experiment with BlueJ

Experiment with the BlueJ projects we saw in lectures.

  1. Login with your CSE login and password set up earlier
  2. Download the Turtle.zip
  3. Unzip this file to create the BlueJ project.
  4. Start BlueJ
  5. Select ‘Open Project’ from the File menu and open the ‘Turtle’ project.
  6. Create a new ‘MyTurtle’ object by right clicking on the MyTurtle class and selecting new MyTurtle()
  7. Give your turtle a name and press OK.

Simple shapes

  1. Right click on the red MyTurtle object and select the void drawSquare(int sideLength) method.
  2. Enter a side length of 100 and press OK.
  3. Observe what happens in the World window.
  4. Try drawing squares of different sizes.
  5. What direction does the turtle face before and after you call the method?
  6. Double-click on the MyTurtle class to open the source-code.
  7. Read the drawSquare method. Can you explain why the turtle has a different direction after the method is called?
  8. What could you do to fix this so the turtle is facing the same way before and after the method?
  9. Change the code so that it draws a triangle instead of a square.

Using the debugger

  1. Read the method drawPolygon and try to understand how it works.
  2. Run it with different parameters to see if it does what you expect.
  3. In the source window, click on the line number for the line “if (numberOfSides < 3) {“. A little red stop sign should appear.
  4. Run the method again with numberOfSides set to 6 and sideLength set to 100. The Debugger window should appear.
  5. Press the Step button and watch how the program steps through the code.
  6. Run the method again with numberOfSides set to 2. Can you predict what will happen?

Spirals

  1. Read the method drawSpiral and try to understand how it works.
  2. Try drawing a spiral with length = 10 on a piece of paper following these instructions.
  3. Use the debugger to step through the method. Does it do what you expected?
  4. Change the line ‘length = length – 2‘ to ‘length = length – 4‘. How will this change the spiral? Run it and see.
  5. Change the line to ‘length = length + 4‘. What happens now? Why?

 

Welcome to COMP1400/INFS1609

Posted by on July 28th, 2013 · Announcements

This course introduces you to the foundations of the programming discipline, which underlies most technical subjects such as software design, data management and algorithms. It will involve both a theoretical component (e.g. learning about basic programming concepts like loops, arrays and functions) as well as a practical component (e.g. implementing simple algorithms in a computer laboratory). The course also provides a first step towards learning the principles of object-oriented design and programming through the use of the Java programming language.

The course is suitable for students with no prior programming experience. It is particularly targeted at IS students as it relates to a number of core concepts that are essential in understanding the technologies behind information systems in business without getting overmuch into low-level technical details.

All students should ensure they have read the Course Outline.

 

Final Lab Marks

Posted by on November 5th, 2012 · Announcements, Labs

The marks for labs have been finalised and uploaded. Check your results here: https://cgi.cse.unsw.edu.au/~give/Student/sturec.php

You should see the following fields:

  • labXX – Lab mark, out of 2 for each lab from weeks 2 to 12
  • labTotal – mark out of 10, the final lab result, worth 10% of the course mark.

To get full marks for labs you needed to fully complete 10/11 labs. For reference the lab total was calculated by summing all labs marks, capping the result at 20 and converting the mark to be out of 10.

 

Assignment 2 & 3 Marks

Posted by on October 30th, 2012 · Announcements, Assignments

Marks for Assignments 2 & 3 are now available for collection. Go to the assignment management page: https://cgi.cse.unsw.edu.au/~give/Student/give.php, and select INFS1609 or INFS2609. Then select “assignment2″ or “assignment3” and press “Collect my Assignment”.

You will be presented with your assignment log. The log contains:

  • Your submitted code
  • Comments within the code
  • A summary of the tests and results
  • Output from incorrect tests
  • Your marks

Carefully read any comments that may have added to your log.

 

Assignment 1 Marks

Posted by on October 15th, 2012 · Announcements, Assignments

Marks for Assignment 1 are now available for collection. Go to the assignment management page: https://cgi.cse.unsw.edu.au/~give/Student/give.php, and select INFS1609 or INFS2609. Then select “assignment1″ and press “Collect my Assignment”.

You will be presented with your assignment log. The log contains:

  • Your submitted code
  • Comments within the code
  • A summary of the tests and results
  • Output from incorrect tests
  • Your marks

Carefully read any comments that may have added to your log.

Lab Week 13 – Marking & Revision

Posted by on October 14th, 2012 · Labs

This lab is the final opportunity to mark outstanding work.

This lab is also an opportunity to ask any revision questions or questions about the exam.

Lab Marks

Posted by on October 8th, 2012 · Announcements

Lab marks have been uploaded. You can view them here: https://cgi.cse.unsw.edu.au/~give/Student/sturec.php

Marks are out of 2. If you do not have 2/2 for a lab then ask Tim in the next lab what is missing.
For Claude’s class, I’ve uploaded marks from week 8 onwards. Claude will upload his marks when he has a chance.

Marks for labs will be finalised in Week 13. So ensure you have completed all lab work by then ready for marking.

Update: Claude, will return on Monday. Please wait until next week before enquiring about marks before Week 8 for his class.

Lab Week 12 – Uno Game

Posted by on October 7th, 2012 · Labs

Download the Uno Game BlueJ project shown in the lecture.

Constructors

Use the debugger to watch how cards are constructed:

  1. Set a breakpoint in the WildDrawCard constructor (line 17).
  2. Create a new WildDrawCard by calling the constructor..
  3. Use the ‘step into’ button to step through the code. Observe how the super() call works.
  4. Repeat this process for the other kinds of cards.

Set up a game:

  1. Call Game.makeStandardDeck() to create a deck (ArrayList) of cards.
  2. Press the Get button to save this deck in a variable.
  3. Call the Game constructor, providing this deck as a parameter.
  4. Call the deal() method on the game you created to deal the cards.

Inheriting methods

  1. Create a selection of cards from the different card classes.
  2. Right-click on each card to observe the methods it implements and the methods it inherits.
  3. Where is the canPlay() method implemented on each card type?
  4. Where is the play() method implemented on each card type?
  5. Set a breakpoint in WildDrawCard.play() (line 26).
  6. Create a WildDrawCard and call its play() method. Use the debugger to step through the code.
  7. Observe the order the code is executed.

Add a new card type

  1. Change the rule for the NumberCard so it can only be played on another NumberCard of value one more or one less that itself. (i.e. a 5 can be only played on a 4 or 6). Numbers should wrap around, so a 0 can be played on a 9 and vice-versa.
  2. Create a Transfer card class which transfers 2 random cards from the player to the previous player.
  3. Add a new Reverse-Draw card class which reverses the direction of play thencauses the next player to draw. Does it have any code in common with other cards? What class would it be best to inherit from?
  4. Create your own card types.

 

Week 11 – Wumpus with interfaces

Posted by on October 3rd, 2012 · Announcements

I finished re-implementing the Wumpus game using the Hazard interface we discussed in today’s lecture. You can find the complete source here.

I have also uploaded revised slides containing the changes I made during the lecture.