This is a continuation of the previous tutorial.
In the last tutorial you should have developed a Defining Diagram for the following problems. In this tutorial you are to develop the Algorithm (Pseudo Code and Data Dictionary) for each problem. The Steps in Program Development (so far) are:
Step 1a: Read the problem carefully
Step 1b: Check your understanding of the problem
Step 2a: Determine the outputs
Step 2b: Determine the processing (actions)
Step 2c: Determine the inputs
Step 2d: Develop a Defining Diagram
Step 4a: Pseudo Code
Step 4b: Data Dictionary
Write Pseudo Code and a Data Dictionary for Question 1 in the previous tutorial. The problem is described again below:
A draftsperson requires a program to calculate the area of rectangular rooms. The user is to input the length and width of the room, the program is to then calculate the area of the room and the length of the perimeter, and then display the area and perimeter length. The area of a rectangle is its length multiplied by its width. The length of the perimeter of a rectangle is twice the length plus twice the width.
Run Length (m) ? 10 Width (m) ? 5 Area = 50.0 Perimeter = 30.0 Run Length (m) ? 2.5 Width (m) ? 4 Area = 10.0 Perimeter = 13.0
Write Pseudo Code and a Data Dictionary for Question 2 in the previous tutorial. The problem is described again below:
A shop owner requires a program to calculate the amount of change to be given to a customer. The price of the item sold and the amount of cash tendered by the customer is to be input and the amount of change is to be calculated and displayed.
Run Price ($) ? 8.95 Cash ($) ? 10.00 Change = $1.05
Run Price ($) ? 20.00 Cash ($) ? 20.00 Change = $0.00
Write the Pseudo Code and Data Dictionary for Question 3 in the previous tutorial. The problem is described again below:
How is the final mark calculated?
A subject has an assignment and an exam. Both the assignment and exam are marked out of 100. The assignment contributes 40% towards the assessment of the subject and the exam 60%. A program is required that allows the user to input and assignment mark (out of 100) and an exam mark (out of 100) and display an overall mark in the proportions specified.
Run Assignment mark (0 to 100) ? 70 Exam mark (0 to 100) ? 60 Final mark = 64%
Run Assignment mark (0 to 100) ? 80 Exam mark (0 to 100) ? 90 Final mark = 86%
Write Pseudo Code and a Data Dictionary for Question 4 in the previous tutorial. The problem is described again below:
Why difficulty is there in writing the Pseudo Code for Question 4 from the previous tutorial?
The Water Board gives a discount of 5% to customers that pay their rates bill early, otherwise the normal rate applies. The program is to display the discount (if applicable) and the amount due.
Run Amount Due ($) ? 200.00 Early payment (Y=Yes, N=No) ? Y Discount = $10.00 Discounted Amount Due = $190.00
Run Amount Due ($) ? 100.00 Early payment (Y=Yes, N=No) ? N Amount Due = $100.00
Due Date: Computer Lab. Week 4
Marks: 2%
The problem described in Question 2 above is to be used for Assessable Tutorial A.
Some information on Assessable Tutorials
Hand in a printout of a document containing the following:
Include a title page with your assessable tutorial, with the following information, in the order shown:
Assessable Tutorial AName:Subject:Tutorial Group:Tutor:Due date: |
Hand the tutorial to your tutor in one of your tutorial classes on or before the Lab session in week 3.
If you are unsure about which tutorial group you are in, refer to the tutorial group listing.
As long as you hand in a reasonable attempt at the requirements you will receive your 2 marks.
Written by Tim Whitfort.