Assignment title: Information
Computer organization and Architecture: (Assignment 1)
Task
1. A digital computer has a memory unit with 16 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory. [4 marks]
a) How many bits are needed for the opcode?
b) How many bits are left for the address part of the instruction?
c) What is the maximum allowable size for memory?
d) What is the largest unsigned binary number that can be accommodated in one word of memory?
2. Consider the MARIE program below. [5 marks]
a) List the hexadecimal code for each instruction. [1.5 marks]
b) Draw the symbol table. [1.5 marks]
c) What is the value stored in the AC when the program terminates? [2 marks]
Hex
Addr Label Instruction
100 Start, Load A
101 Add B
102 Store Temp
103 Load C
104 Add D
105 Add Temp
106 Store F
107 Output
108 HALT
109 A, DEC 5
10A B, DEC 3
10B C, DEC 4
10C D, DEC 13
10D E, DEC 3
10E Temp, HEX 00FD
10F F, HEX 00FE
3. Write code to implement the expression
F = (A+B) /(C*D*E) on 2-, 1- and 0-address machines. [6 marks]
Online submission via Turnitin is required for this assignment.
Rationale
This assessment task covers topics on CPU operation and Instruction Set Architecture, and has been designed to ensure that you are engaging with the subject content on a regular basis. More specifically it seeks to assess your ability to:
• be able to define and appropriately use computer systems terminologies;
• be able to describe the essential elements of computer organisation and discuss how the elements function;
• be able to describe the basic instruction set architecture of a simple computer;
• be able to discuss the general trends in computing technologies including examples of leading edge developments.
Marking criteria
The following marking criteria will be used to mark this assignment:
Questions Fail (<50%) Pass (50% - 64%) Credit (65% - 74%) Distinction (75% - 84%) High Distinction (>84%)
Question 1 &2 Incorrect answer with no demonstration of understanding the topic. Student demonstrate the understanding, however the calculations are incorrect. Answers are correct, omission of few calculations. Answers are correct, but the steps have minor kistakes. Answers are correct and clearly show the calculations
Question 3 Answers are incorrect Any one address is fully correct and the remaining 2 address are not correct Any 2 addresses are fully correct and the remaining 1 address is not correct All the three addresses are correct, but has some minor steps mistakes Total marks Answers are fully correct with the steps.
Programming principles : (Assignment 2)
Task
a)
An insurance company wants to get a rough estimate of their annual car insurance income. The company has three types of car insurance as: basic, intermediate and comprehensive. Write a program that will ask the user to enter the insurance company name, year, the number of insurance policies sold of each car insurance type. The average insurance premiums of each car insurance policy type are $500, $650 and $800. The above prices include a 10% Goods and Services Tax (GST). Finally, the program should display the amount of annual earned for each car insurance type (excluding the GST) and the total amount of money earned for all the three car insurance types. Then, the program should prompt the user with the message "Do you wish to repeat for another year? [Y/N]: ". If the user selects 'Y' or 'y' the program should repeat. If the user selects 'N' or 'n' the program should terminate and print 'Thank You! ------ See You Again!'
Notes: you are expected to use selection, repletion and functions in this program.
Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified. You may specify the algorithm for the functions separately and refer to the function name in the algorithm for the main program. Your program design should include constants, selections, repletion and multiple functions.
Specify 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Select another 2 sets of test data that will demonstrate the 'abnormal' operation of your program. Set these out in the same format as in Assignment 1.
Implement your algorithm in Python.
Use separate functions to perform the task, instead of having only one single main function.
The 'main' function should prompt for user input and then call other function/s that calculates the income generated. Make sure your program has both a 'main' function and at least one other function that is called from the 'main' function to calculate the income. Remember to call the 'main' function at the bottom of your program or it will not execute.
Use triple quoted 'docstrings' to document your function, and add other 'end of line' comments as necessary to explain your code.
Run your program using the test data you have selected and save the output it produces in a text file.
Submit:
1. Your algorithm.
2. The table recording your chosen test data.
3. Source code for your Python implementation.
4. Output listings demonstrating the results of using the test data.
It is important that the output listings are not edited in any way.
Rationale
Reinforce topic material on simple functions.
Reinforce topic material on decision structures and Boolean logic.
Marking criteria
Assessment Criteria Performance Standards
FL
(Does not meet the PS requirements)
0 – 49 % PS
(Meets the requirements below)
50 – 64 % CR
(Meets PS requirements plus those below)
65 – 74 % DI
(Meets CR requirements plus those below)
75 – 84 % HD
(Meets DI requirements plus those below)
85 – 100 %
0 - .99 marks 1 - 1.29 1.3 - 1.49 1.5 - 1.69 1.7 - 2.0 marks
Produce an algorithm in pseudocode (structured English).
(2 marks) A significant number of errors in the produced algorithm. Only a small number of errors in the produced algorithm. It includes repetitions and selections. No errors in the produced algorithm. It includes at least one function, repetitions and selections. All variable names in the produced algorithm are meaningful. It includes functions, repetitions and selections. All statements in the produced algorithm are necessary. It includes several functions, repetitions and selections.
0 - .99 marks 1 - 1.29 1.3 - 1.49 1.5 - 1.69 1.7 - 2.0 marks
Select 'normal' and 'abnormal' test data.
Present the test results.
(2 marks) Selected test data are not clearly presented in a table or do not allow easy calculation of output. Selected test data are clearly presented in a table and allow easy calculation of output. Selected test data present both normal and abnormal data. Sound reasons are provided for the selection of test data. Test data explore every branch of the program.
Clear explanation provided of the expected output of the test results.
0 - 1.99 marks 2 - 2.59 2.6 - 2.99 3 - 3.39 3.4 - 4 marks
Produce the necessary Python code.
(4 marks) The produced Python code does not execute properly, and/or contains syntax errors and/or produces incorrect results. The produced Python code executes properly without any syntax errors producing correct results. Program includes selections, repletion. In addition, the produced Python code is fully documented with appropriate comments. All variable names are meaningful. In addition, the produced Python code implements the pseudocode correctly. Program includes functions. In addition, the produced Python code contains only necessary statements and variables.
0 - .99 marks 1 - 1.29 1.3 - 1.49 1.5 - 1.69 1.7 - 2.0 marks
Present the actual output of the program.
(2 marks) The presented test output does not match the actual results that can be obtained from the execution of the program. The presented test output matches the actual results that can be obtained from the execution of the program. The presented test output is correct. The test output is correct for any test data in addition to those used in the submitted table to report the test result. The presented test output is in the form specified in the assignment.
b)
In the Resources section of the Interact2 subject website there is a data file called students.txt. This file contains details of students: a valid student number, course (BIT or MIT) and the specialisation (ex: software design and development). Each student number is an eight digit number such as 11556677. (Note: Two records in the file have intentionally been "corrupted" - for testing purposes.)
Design an algorithm and use it to write a Python program that displays the below menu and loop it to allow the user to perform different tasks.
Student Information System
1. Add a new student
2. Search a student
3. Delete a student
4. exit
Select an option [1/2/3]:
If the user selects the option 1 the user to add new students into the file, if the user selects option 2 the program should read the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list. The loop should terminate when an "empty" input occurs - i.e. when the user presses the [Enter] key on its own. (Obviously this last entry should NOT be checked against the list!) If the student number input matches an element somewhere in the list, the program should display the number together with the course and the specialisation. If the number input does not match any element in the list, then the program should display the number and a message saying that it IS NOT a valid student number. If the user selects the option 3 the program should prompt the user to enter a student number. Then, the program should delete that student record from the file and notify the user with the message 'the student was deleted from the file…!'. However, if the student number does not exist the user should be notified the user by displaying the message 'the student does not exist in the file…!'. If the user selects option 4 the program should terminate and display the message 'Thank you..! See you again…'.
Notes:
The algorithm should be written in pseudocode (structured English).
The records read from the data file should be checked and NOT placed into the list if they are something other than an 8 digits. (Display a sensible message if the file is found to have corrupt records in it.)
The numbers entered by the user should be checked to ensure they are valid digits (as distinct from valid student numbers) and not processed further if they are not.
Your programs should use one or more functions where sensible, and be documented fully.
Use exceptions where necessary.
Specify 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Show your test data in a table as you have done in earlier assignments.
Run your program using the test data you have selected and save the output produced in a single text file.
Submit:
1. Your algorithm and test data table.
2. The table recording your chosen test data.
3. Source code for your Python implementation.
4. Output test file demonstrating the results of using the test data.
5. Contents of the data file cars.txt read by the program.
It is important that the output listings are not edited in any way.
Rationale
Reinforce topic material related to files and exceptions.
Reinforce topic material related to lists.
Presentation
You MUST prepare and present all source code, output from test runs, and other documentation as separate files within a single directory (folder) identified by your name. This directory will later be compressed into a single ZIP file - see the "Requirements" section below.
• The Python source code you write should be saved with a name such as ITC106_Ass_1.py by choosing File > Save As, from the IDLE "edit" window.
• The test run (or runs) produced when your Python program executes should be saved with a name such as ITC106_Ass_1.txt by choosing File > Save As, from the IDLE "run" window. (N.B. When testing your final program, start with a new (empty) run window, perform ALL necessary test runs one after the other, then when finished save the contents of the "run" window into ONE file showing ALL test runs in the order that you carried them out. This order should match the order of the test in your "test data table").
• The other documentation (such as your pseudocode, and your table of test data etc.) should be saved in a Word document with a name such as ITC106_Ass_1.doc.
Thus your directory for Assignment A1 will contain three files - and be identified with your name (and not the name of the subject or the assignment).
It is critically important that your test runs (saved as one file with a .txt extension) are unmodified outputs from your program, and that these results should be reproducible by the marker running your saved .py python program in IDLE. In this subject test runs, and python program listings are NOT to be cut and pasted in any form from the IDLE windows. (For example you might be tempted to cut the output from test runs and to paste it into a Word document to create a "pretty" assignment with headers and footers the way you might be used to doing for other subjects. DO NOT DO THIS! The un-edited contents of the "edit" and "run" windows from IDLE is all we want to see in the .py program listing file and the .txt test run file.)
Requirements
Once you have saved the three files (as described under "Presentation" above) into a single directory identified by your name, you MUST compress that directory into a single ZIP file (and only a ZIP file - not a RAR file or some other compressed file format), as outlined in the section on presentation.