Information Technology Problem Solving and Program Design Introduction

Information Technology Problem Solving and Program Design Introduction to programming 1/4/2022 1

What is a problem? A question to be considered, solved, or answered: math problems; the problem of how to arrange transportation, etc 1/4/2022 2

Introduction • Software is the name given to computer programs that tell (instruct) the hardware how to work. • Software includes computer programs that create system and application software. 1/4/2022 3

Solving the problem l l 4 The first step is to think about a method and develop an algorithm to solve the problem. An algorithm is a sequence of precise instructions, which results in a solution. 1/4/2022

Phases of problem solving/ steps in solving a problem Problem solving is usually broken into two phases which comprise of six (6) steps. • Algorithm phase 1. Clearly define the problem that you want to solve 2. Design an algorithm that is precise and well thought out to solve the problem. 3. Test your algorithm on paper. 1/4/2022 5

Cont’d • Implementation phase 1. Translate your algorithm into a programming language such as BASIC, Pascal, C or C++. 2. Test the program to make sure it produces the correct results 3. Document the program. This is where you write comments on how to use the program and how it works. 1/4/2022 6

Defining a problem When you first analyze a problem, you should specify its objectives, that is, what the program is meant to do. Here are steps achieve this objective: 1. 2. 3. 4. Specify the output: what kind of output I expect from this program? What form should it be in? Specify the input: you can specify what the input should be. Specify the processing: what processing should be done on the input to get the necessary output? Specify the storage: determine how the data and even the information or results will be stored temporarily/permanently. 1/4/2022 7

Input-Processing-Output charts Once you have analyzed the problem and ready to write the program, it is best to record the details of input, process and output of the program module. IPO charts are used to identify the • Outputs- the goal of the problem solution • Inputs- the information you need to solve the problem • Processes- the steps needed to convert the input information to the desired outputs. 1/4/2022 8

Problem 1 • Find the sum of three (3) numbers. Use the IPO chart to help Input 1/4/2022 Processing number 1 read three numbers number 2 add the three numbers together number 3 output the sum of the numbers Output sum 9

Problem 2 • Write a program to enter the minimum and maximum temperature and find the average. 1/4/2022 10
- Slides: 10