Sunday, November 16, 2008

ICAB4225A Automate Processes

Welcome to the Automate Processes (ICAB4225A) blog. This blog will help you understand about programming.

Assessment information

To successfully complete this unit, Automate processes (ICAB4225A) this blog will be shown about automate solutions by using basic scripting processes and application-specific scripting options.

Automating processes is an integral part of contemporary computing; using inbuilt scripting languages is a key part of that. Applications or systems administration personnel need to continually examine options to automate processes, to that way enhance performance.

To successfully complete this unit, this blog will shown how to design and develop algorithms.
Also need to be able to develop an algorithmic statement of a solution for a set process.

Assessment tasks will require you to show you are able to:


  • Develop algorithms to represent solution to a given problem
  • Describe structures of algorithms
  • Design and write script
  • Verify and review script
  • Document script.

Task 1: Identify algorithm structures

Activity 1.1: Investigate flowchart symbols

Using a web browser, go to the Q-Skills website at: http://www.q-skills.com/flowchrt.html. Look at ISO9004.4. Section A.6.2 which describes four basic symbols to be used in flow charts.

Q: What are the four basic flowchart symbols and what do they represent?

A: Following table is shown the basic flow chart symbols and they represent.




Activity 1.2: Write an algorithm demonstrating sequence

Q: Write an algorithm that will accept two numbers, add them together, multiply by 27 to the total and then display the total.

A: This figure is an algorithm that accept and add two number together, then multiply by 27 to the totlal and display the total.



Activity 1.3: Write an algorithm demonstrating selection

Write an algorithm that will accept a test mark between 0 and 100. Display the grade that the student receives based on the table below:



A: The below ficgure shows an algorithm to accept a test mark between 0 and 100 and also display the grade that the student will receives.



Task 2: Apply algorithm structure to give a solution

Activity 2.1: Create an abstract design

Q: Write an algorithm to process the pay information for employees according to the following:

  • To process each pay, the operator will input the hours worked and the pay rate.
  • Tax of 30% is to be deducted from the gross pay.
  • The information to be displayed is the gross pay, tax deducted and the net pay (gross pay minus tax).
  • After processing each pay, the operator will be prompted to process another pay. If the operator types in the character ‘y’ (uppercase or lowercase), another pay is to be processed. Any other response to this prompt will end the program.

A: This is one of the possible solution.

Activity 2.2: Review abstract design

Design a set of inputs that could be used to conduct desk-checking of the algorithm below. The test data should test program flow control, correctness of calculations and assignments to variables. The algorithm should meet the program specifications presented in Activity 1.

Q: Perform a desk-check on the algorithm using your test inputs. Does the algorithm meet the program specifications? If not, what errors did you identify?

A: According to the algorithm in 2.1 answer, This algorithm does not meet program specifications because of two problems:

  • Problem 1 — The gross pay is displayed twice and the net pay is not displayed.
  • Problem 2 — If the operator responded with uppercase Y when prompted to process another pay, the algorithm stops.

The IF and the ELSEIF both test for the lowercase ‘y’. One of them should test for uppercase ‘Y’.


Task 3: Develop and verify script language for an algorithm

Activity 3.1: Translate an algorithm to script code

Translate the following algorithm into script code using Python. Execute your script with the numbers 3 and 5.
Q: What is the result displayed by the script? Describe what the code is doing using one sentence.

A: The value displayed for result should be 12.



Activity 3.2: Identify and correct a logic error



Q: Find and correct the logic error(s) in the script.

A: There are 3 logic error followed:

Logic error 1: In the while loop, the else should not change the loop control variable (gotConvertTo) to 1. This allows any character to be entered from the keyboard and the script continues. This line should be deleted.

Logic error 2: This is more like a ‘copy and paste’ error. The code executes as it should, but the output would be misleading. The print statement in the section where the original temperature is converted to Celsius (the last if), should read Fahrenheit where it reads Celsius. It should be:

if convertTo == 'c':
newTemp = temp—32 * 5/9
print 'Original temperature entered was',temp,'Fahrenheit'


Logic error 3: The mathematical formula to convert to Celsius requires that 32 be subtracted from the temperature BEFORE the multiply and divide. The code should enforce a change in the order in which the calculations would be performed to allow the addition to occur first. The addition part should be in parentheses to force the addition to occur fist as shown:

newTemp = (temp—32) * 5/9

Key terms


Algorithm: A procedure or set of steps to accomplish a specific task

Computer program: The embodiment of an algorithm in a computer language, so that it can be executed on a computer

Sequence: The simplest type of flow in algorithm design, where actions are carried out in the stated order; see also ‘selection’ and ‘iteration’

Selection: A flow-pattern in algorithm design, where a choice is made about which action to perform, depending upon a logical condition; the most common selection structure is IF/ELSE; see also ‘sequence’ and ‘iteration’

Iteration: a flow-pattern in algorithm design, also known as looping or repetition; actions are performed over and over again; a loop condition determines when the loop will finish; see also ‘sequence’ and ‘selection’

Pseudocode: A language-neutral representation used to show the logic, structure, and calculations of algorithms

Variable: A container with a name, to hold values during program execution; when a variable is declared in a program, some memory is set aside to hold its value

Software development life cycle (SDLC): A procedural framework for developing computer software and information systems

Top-down design: The development of a program by dividing the original complex task into smaller, less complex tasks, and then applying the same process to each smaller task, until the tasks translate easily into code statements

Desk-check: A code testing process where the code is manually executed

Walk-through: A review of requirements, designs and or code by a group; its purpose is to analyse the programmer’s logic and assumptions

Function:A named section of code that performs a particular task

Array: A collection of data items that can be accessed using a common name and an index

1 comment:

Unknown said...
This comment has been removed by the author.