Uploaded by Zunaira Amjad

Assignment#1

advertisement
Assignment#1
Q1. A solution to a problem is decomposed into its component parts. Name the component
parts. [3]
Q2. A phone app is being developed to split the cost of a restaurant bill between a given
number of people. It is being designed to work for up to 12 diners and for bills from $10 to
$500.What validation checks should be used for the number of diners and the size of the
bill? (Hint: name the validation checks eg range check for the marks allowed) [5]
Q3. What is the difference between validation and verification and why do we use both
concepts? [2]
Q4. Write the pseudocode to input any number of positive numbers and find the total and
average. The user should enter '-1' when they have finished entering their list of positive
numbers( Hint: average = total/number of instances and use of repeat/while loop) [5]
Q5. Draw a trace table for the bubble sort algorithm on pg 276 in the book and use the test
data 35,31,32,36,39,37,42,38 to record a dry run of the pseudocode. [10]
Q6. Write an algorithm using pseudocode or flowchart to check that the length of a password
is between 8 and 12 characters. [10]
Do activity 7.6 on pg 271 and q6,7 and 8 in the book on pg 296 to 298 [20]
Download