CheckPoint: Algorithm Verification
• Answer the following questions about the information in Appendix J:

o What will be printed if the input is 0?
“You fail”
o What will be printed if the input is 100?
“Your grade is 100” and “You did great”
o What will be printed if the input is 51?
“Your grade is 51” and “You did well”
o What will be printed if the user enters “Wingding”?
“How did you do?” – because Wingding is not a value between 0 and 100. o Is this design robust? If so, explain why. If not, explain what you can do to make it robust.
This design is pretty good, but could use a little bit more backbone. It doesn’t specify what the output will be if a non-numeric value is inputted – there should be an error output in the design. I also think that it should have an output value that would give the test score in a percentage form. o How many levels of nesting are there in this design?

There are three nested loops in this design.
o Provide a set of values that will test the normal operation of this program segment. Defend your choices.
Test Values
Input (X)Output
15You fail
48You fail
86Your grade is 86 – You did great
69Your grade is 69 – You did OK

o Provide a set of test values that will cause each of the branches to be executed.
Test Values
Input (X)Output
30You fail
60Your grade is 60 – You did OK
80Your grade is 80 – You did well
90Your grade is 90 – You did great
500How did you do?

o Provide a set of test values that test the abnormal operation of this program segment.
Test Values
Input (X)Output
HelloHow did you do?
120How did you do?
GuessHow did you do?

Anything other than a numeric value between 0 and 100 will return the same output.

...Associate Program Material
Appendix H
Repetition and Decision Control Structures
In one of the week 3 discussion questions we discussed the algorithm that would be required to make a peanut butter sandwich. In this CheckPoint you will need to take that one step further and create a program design to make a peanut butter sandwiches. Below you will find a partial program design; you need to complete it by adding the pseudocode in the required areas. You need to add one repetition (loop) control structure and one decision control to complete the program design. The user will decide how many sandwiches are made; this is where the loop will be used. The user will decide if the sandwich includes jelly, and, if it does, what flavor of jelly; to keep it simple we are only allowing grape or strawberry jelly.
Analysis
Process:
1. Ask user how many sandwiches to make
2. Ask user if they want jelly on their sandwich
3. If jelly is requested, ask user what flavor (grape or strawberry) of jelly they would like
4. Make peanut butter and, if required, jelly sandwiches
Input:
NumberOfSandwiches (integer)
IncludeJelly (string; values Yes/No)
TypeOfJelly (string; values Grape/Strawberry)
Output:
Sandwich
Design
Main Module
Declare NumberOfSandwiches as integer
Declare IncludeJelly as string
Declare TypeOfJelly as string
Declare Continue as Boolean
Set Continue...

...account of the papers studied 3
3.1. Minutiae recognition system based on genetic algorithms 3
3.2. Fingerprint matching algorithms for integrated circuit cards 4
3.3. Algorithm based on tree comparisons using ratio of relational distances. 5
3. Comparative account of the papers studied 6
4. Conclusion 6
5. References 7
A SURVEY ON FINGERPRINT VERIFICATIONALGORITHMS
Ms. Tasleem Fathima J
ABSTRACT
Fingerprints are the most widely used and trusted biometrics that uniquely identify an individual and are used for various purposes like authentication, law enforcement etc. Some of the techniques used to match finger prints are: filter based, minutiae or Galton feature’s based, correlation based, pattern matching. The most commonly used technique is minutiae based which involves identifying the various features of a fingerprint like ridge endings, ridge bifurcation, island, core, delta, crossover etc. The accurate locations and directions of these minutiae points identified are stored in the database for testing the methods proposed by the papers. There are around 20-60 minutiae points in a fingerprint. The number of minutiae points considered highly affects the efficiency of the system. The algorithms proposed by the papers under study strive to improve the efficiency of the computation involved. Each of the...

...Analysis
Process:
1. Display program welcome message
2. Ask for item name
3. Ask for item price
4. Ask for pound weight
5. Ask for ounces
6. Convert pounds to ounces then add to input ounces
7. Divide total price by ounces
8. Display the price per ounce.
Input:
Item Name
Item Price
Item Weight in pounds
Ounces as integer
Output:
Unit price
Main Module
Declare Name as String
Declare Price as real
Declare Lbs as integer
Declare Oz as integer
Declare UnitPrice as real
Display "Marc’s Unit Pricing Program"
Display "This program will break down the weight of an item from pounds to ounces, and will then give you the price per ounce for the product listed."
Call Input Data Module
Call Perform Calculations Module
Call Output Results Module
End Main Module
REM now we get all the pertinent information that we need.
Input Data Module
Display "Name of the Item?"
Input Name
Display "How much does it cost?"
Input Price
Display "Item Weight in pounds only?"
Input weight in Lbs
Display "Please enter any additional ounces if listed?"
Input Oz
Display “Please confirm if the entry is correct.”
PAUSE
If yes then
Display “Enter to continue”
Or else
Call input data module again
End Input Data Module
REM it is time now to calculate or break down theunit price into size’s which this module does.
Perform Calculations Module
Set Oz = 16
UnitPrice = Price/Oz
End Perform Calculations Module...

...
Week 3, Checkpoint, Sequential and Selection Process Control Structure
Payroll tax Calculation System Requirements
-Salary Range 1 is 0.00 -1,499.99
-Salary Range 2 is 1,500.00-2,999.99
-Salary Range 3 is 3,000.00-4,999.99
-Salary Range 4 is 5,000.00-7,999.99
-Salary Range 5 is 8,000.00-14,999.99
-If the Salary Range is greater than 0.00, then the tax base is 0.00 plus 15% of the amount over 0.00 (amount-0.00*15%+0.00)
-If the Salary Range is greater than 1,500.00, then the tax base is $225.00 plus 16% of
the amount in excess of 1,500.00 (amount -1,500.00*16%+225.00)
-If the Salary Range is greater than 3,000.00, then the tax base is $465.00 plus 18% of
the amount in excess of 3,000.00 (amount-3,000.00*18%+465.00)
-If the Salary Range is greater than 5,000.00, then the tax base is $825.00 plus 20% of the amount in excess of 5,000.00 (amount-5,000.00*20%+825.00)
-If the Salary Range is greater than 8,000.00, then the tax base is $1425.00 plus 25% of the amount in excess of 8,000.00 (amount-8,000.00*25%+1425.00)
Input-Process-Output Chart
Input
Process
Output
(keyboard)
Get the amount of salary earned
GrossSalary (integer)
Salary (integer)
Calculate the total tax and adjusted net salary
GrossSalary (integer)
BaseTax (float)
AddlTax (float)
TotalTax (float)
NetSalary (float)
GrossSalary (integer)
BaseTax (float)
AddlTax (float)
TotalTax (float)
NetSalary (float)
Display the Gross Salary, Base Tax, Additional Tax...

...Algorithms Homework – Fall 2000
8.1-1 Using Figure 8.1 as a model, illustrate the operation of PARTITION on the array A =
13 19 9 5 12 8 7 4 11 2 6 21
i j j
6 19 9 5 12 8 7 4 11 2 13 21
i i j j
6 2 9 5 12 8 7 4 11 19 13 21
i ………………………… j
return 11, SPLIT = and
8.1-2 What value of q does PARTITION return when all elements in the array A[p…r] have the same value?
q = (p+r)/2, where p = index 0, and r = highest index
8.1-3 Give a brief argument that the running time of PARTITION on a subarray of size n is (n).
In the worst case, PARTITION must move the j pointer by one element (to the 2nd to last element), and the i pointer all the way to j, making a comparison at each element along the way. Since there are n comparisons made, the running time is (n)
In the average (and best) case, PARTITION must move the j pointer to an element at or near the half-way point in the array and the i pointer all the way to j, making a comparison at each element along the way. Once again there are n comparisons made and the running time is (n)
8.2-1 Show that the running time of QUICKSORT is (n lg n) when all elements of array A have the same value.
T(n) =...

...INFORMATION TECHNOLOGY ASSIGNMENT
ON ALGORITHM
Done by
Densil Hamilton
INTRODUCTION
This Assignment was done to show the methods of algorithm. It outlines the meaning of algorithm and steps to be carried out to complete a give problem. Examples were also shown for the methods of representing algorithm.
What is an Algorithm?
An algorithm consists of a set of explicit and unambiguous finite steps which, when carried out for a given set of initial conditions, produce the corresponding output and terminate in finite time. (How to Solve it by Computer, RG Dromey, Prentice Hall UK, 1982)
This is done by a series of steps:
1. Input: there are zero or more quantities which are externally supplied;
2. Output: at least one quantity is produced;
3. Definiteness: each instruction must be clear and unambiguous;
4. Finiteness: if we trace out the instructions of an algorithm, then for all cases the algorithm will terminate after a finite number of steps;
5. Effectiveness: every instruction must be sufficiently basic that a person using only pencil and paper can in principle carry it out. It is not enough that each operation is definite, but it must also be feasible.
WAYS OF REPRESENTING ALGORITHMS
Two ways of represent an algorithm are:
Flowcharts
Pseudo Code
FLOWCHARTS
This is a...

...The different tasks and duties that the police department performs are divided among its members. The tasks of the organization are divided according to personnel. Work assignments are designed so that tasks are given to particular personnel to get accomplished. In the police department, patrol functions are separate from detective functions, which are separate from internal investigative functions. Where the officers are located and the times that they work are established so that the area is covered at all times. The chain of command is established so that each member knows their duties and who they report to. The superiors will know who they are in charge of and the areas that they are in control of. The police departments' operational units are responsible for maintaining order, enforcing the law, and providing services to citizens. Organization is very important to the effectiveness of the police department. Police have areas, or a beat, that they are assigned to in order to maintain order, enforce the law, and provide services to citizens. The patrolmen have times that they are assigned to these areas since the job is one that is a twenty-four hour job and areas must be covered at all times. They also have a purpose which is to complete or maintain the task that they are hired to perform. It is very important for the police department to be organized in order to maintain a safe community for everyone to live in. While it seems that crime is getting worse,...

...|Top-Level Object |Communicates With |Incoming Messages |Outgoing Messages |
|Graphical Interface/Central Computer |Communicates with the door, microwave |Incoming messages are from the user,|Outgoing messages tell the generator to |
| |generator, and table spinner |i.e. power, timing, etc., also from |begin making the waves, the table |
| | |the door which tells the GUI if the |spinner to spin, and displays things on |
| | |wave generator is safe to go on |the screen such as the time remaining, |
| | | |power settings and other specifics. |
|Door |Communicates with the GUI and computer to be |No incoming messages except from the|Outgoing messages whenever the door is |
| |sure that you can only turn the device on if |user who can open and close the door|opened or closed, it must inform the |
| |the door is closed |...