CSCI0050 Modifying Component Data
CSCI0050 Homework: Modifying Component Data

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

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: 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 class for the Items for sale, as well as a catalog of all items. There is a tuple 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. There are four comments in the code marked Memory point. Show the contents of memory (environment and store) at each of these four points.

You can write these in a text file or draw (and scan to PDF) pictures of memory drawn on paper. Just make the information for each memory point is clearly labeled so we see which memory layout goes with each point.

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

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, like .01 for 1% – use .01 as the default/initial interest rate). Checking accounts are limited to three withdrawals per month, so these accounts also track how many withdrawals remain (for the given month).

Create classes, tuples, variables, etc as needed for managing accounts, then write the following programs:

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 (operations) made on accounts. The manager wants your code to remember every account creation, deposit, and withdrawal action that was taken. 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 this project.

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

Submit a zip file with your files from this assignment. Your Pycharm project can be a separate zip within this overall zip.