CSCI0050 Modifying Component Data
CSCI0050 Homework #9: Modifying Component Data

Due: Monday, August 5 by 1pm (not 6pm as has been usual). This earlier time allows us to start doing review meetings Monday afternoon. Handin as usual through the Google form.

There is one set of problems for everyone on this assignment. However, the second segment of programming problems (labeled below) is directed at those aiming for As in the course. If you are not trying to get an A, you can focus on the first set of programming problems and skip the second.

Collaboration Policy: No collaboration permitted. You must do this assignment on your own. Include a collaboration statement attesting to this.

Memory Tracing (No Programming)

Put your answers to this in a text file called tracing.txt

Here is part of a program for managing orders in an online store. There is a data structure for the Items for sale, as well as a catalog of all items. There is a data structure for Orders, which capture the name of a customer and a list of items that the customer wants to buy. There are also two versions of a function to update the price of an item in the catalog.

At the bottom of the file is a sequence of expressions to evaluate.

Data Design Exercise (No Programming)

Put your answers to this in a text file called scheduling.txt

A university wants to set up data structures and programs to manage how students enroll for courses. There is a master catalog that contains the course names/numbers, and descriptions for all approved courses. Separately, there is a schedule for each semester that indicates which courses are being offered and at what times. You may assume that all offered courses are part of the catalog.

In addition to the schedule of offered classes, individual students also have their personal schedules. A student’s personal schedule consists of a collection of 3-5 courses, none of which should be meeting at the same time.

Answer the following questions about how you would design the data structures, choose concrete data types, and design key functions in a Python program to implement the scheduling system. (Don’t write any actual code for this – this is a conceptual exercise, not a coding one.)

Programming Exercise

Put your answers to this in a text file called banking.py

Your overall goal is to write several programs that handle basic operations at a bank. The bank offers both checking accounts and savings accounts. Each type of account has a (unique) id number, the name of the customer who owns the account, and the current balance. In addition, savings accounts have an interest rate (a float–for this assignment, use .02 as the interest rate for all accounts). Checking accounts are limited to three withdrawals per month, so these accounts also track how many withdrawals remain (for the given month).

Create data structures and variables as needed for managing accounts, then write the following programs. Your data structure choice should enable the programs to run efficiently (ideally, in less than linear time in the number of accounts).

For all of the following programs, you may assume that the requested ID number is already in use (you don’t have to worry about ID numbers not being found, etc.)

This next part is for those aiming for As in the course

Now that the basic banking features are working, the bank manager asks you to add a way to remember the history of transactions made on accounts. The manager wants your code to remember every account creation, deposit, and withdrawal action that has been taken since your code file was last loaded/run. The bank wants to use this information for two purposes: first, to let account holders see a history of their transactions, and second, to let the bank create reports on activity across all of the accounts.

Tips and Hints

Get your solutions to the first set of programming problems done and working before you add the transactions histories. This way, if you don’t get transactions histories done, you still have a solid piece of work to bring to your review meeting. You may want to save a copy of your work on the initial programming problems as a separate Python file in your project (not required).

Grading Expectations

As the final assignment, this is your chance to pull together what you have learned about data structures, coding, organizing code (into helpers), and testing. We’ll be looking at all of these when we do your in-person review of your work on this project.

During the review, Kathi will ask you to explain certain parts of your work. Other questions may include how/why your code works, what choices you might have made differently, and so on. This isn’t something you need to study for — we’re just going to go over your ideas and solutions for the problems on this assignment.

If you’ve been struggling in the course, we’ll focus on the basic banking functions in your review rather than the transactions history. You can pass the course/assignment without doing the transactions histories, but those aiming for As should do the transactions histories as well.

What to Turn In

Upload three files: “scheduling.txt”, “tracing.PDF” (or "tracing.txt"), and “banking.py”.