Computer Science I for majors by James Tam |
Due at 4 PM. For assignment due dates see the main schedule on the course webpage.
Login to your UNIX account*
Start a script session *
Show your location (path) in the UNIX file system.
Show the contents of your current directory (your home directory)
Go to the official course directory for CPSC 231 Assignment 1 (/home/231/assignments/assignment1)
Show the contents of your current directory (official A1 course directory)
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. Take away learning: you only have limited file permissions in the course directory]
Copy the 'index.txt' file to your home directory
Return to your home directory
Show the contents of the your home directory. (It should include the file 'index.txt' now.)
Delete the 'index.txt' file from your 231 directory [JT's comment: it should work now because it's a directory that you created rather than the course directory]
End the script session*
Submit your assignment (the file called "typescript" using D2L as described on the course web page [D2L link]).*
The lines marked with a star '*' don't directly yield any marks but must still be completed in order for Part 1 of the assignment to be marked. You will either receive full marks for each step in Part I or no credit. You don't need to include contact information in the typescript (partly because some of it will be displayed in Step #3 but mostly because you will be including this information in Part II).
Write a Python program that will calculate a simplified version of the actual calculations used to calculate your term grade. For the assignment you just need to worry about 3 components: assignments (proportion of term grade = 30/100), midterm (proportion of term grade = 30/100), final exam (proportion of term grade = 40/100). You only have to enter a single aggregate value for assignments for simplicity. It's assumed that if you can do the calculation for one that you can do it for several values. If you want to see the full blown grade calculator spreadsheet. An example of the data entry of the values for the three components is shown in Figure 1.