Lecture notes for Computer Science I by James Tam | Return to the course web page |
Raw score | Letter |
29 - 30 | A |
27 - 28 | A- |
25 - 26 | B+ |
23 - 24 | B |
21 - 22 | B- |
19 - 20 | C+ |
17 - 18 | C |
15 - 16 | C- |
13 - 14 | D+ |
11- 12 | D |
9 - 10 | D- |
< 9 | F |
Login to your UNIX account*
Start a script session *
Show the contents of your home directory
Show your location (path) in the UNIX file system
Make a new directory called '231'
Show the contents of your home directory
Enter the newly created ‘231’ directory
Show the contents of the newly created ‘231’ directory
Show your location (path) in the UNIX file system
Go to the official directory for CPSC 231 (/home/231)
Show the contents of the CPSC 231 directory
Show your location (path) in the UNIX file system
Go to the directory for Assignment 1 (/home/231/assignments/assignment1)
Show the contents of the Assignment 1 directory
Show your location (path) in the UNIX file system
Display the contents of the file called 'index.txt' onscreen. Show the file one screen a screen at a time (with a prompt for the user to continue) rather than all at once. [JT's comment: This step may result in a small amount of 'garbage' or nonsense text appearing on your paper printout. If the garbage only appears for this step (partway through the display of this file) and/or each of your steps is clear enough for your marker to see each distinct step then you can still get full marks for this assignment.]
Try to delete the 'index.txt' file [JT's Hint: you aren't supposed to be able to complete this step successfully but instead you should get an error message.]
Copy the file to the newly created ‘231’ directory that you created in your home directory
Go to the 231 directory that is located in your home directory
Show the contents of the ‘231’ directory. (It should include the file 'index.txt' now.)
End the script session*
Submit your assignment (the file called "typescript" using the submission mechanism described on the course web page [UNIX submit program]).*
The lines marked with a star '*' don't directly yield any marks but must still be completed in order for this part of the assignment to be marked.
You are to write a Python program that will implement the compound interest formula: amount = principle * (1 + interest)time. This program will prompt the user for the amount to be invested (principle), the number of years to invest the money (time) and the yearly interest rate. The user should be able to enter the interest rate as an integer value (e.g., 11% instead of 0.11%). Only fractional interest rates will require a real number value to be entered (e.g., 3.25%). The program will only display two fractional digits for amount.
Marking:
Feature |
Marks |
Prompts for principle, rate, time | 3 |
Allows an integer to be entered for non-fractional interest rates | 2 |
Correctly calculates the amount earned | 2 |
Displays the amount earned (value must be correct) | 1 |
Only displays 2 decimal digits for the amount earned | 1 |
TOTAL | 9 |
Style |
Marks |
Documentation | 2 |
Good naming conventions | 1 |
TOTAL | 3 |