1. The document provides an introduction to problem solving concepts and algorithms. It discusses general problem solving strategies like understanding the problem, devising a plan, carrying out the plan, and looking back.
2. It defines an algorithm as a set of steps to solve a problem and discusses the major components of algorithms - input, processing, and output. Properties of algorithms like finiteness, definiteness, effectiveness, and generality are also outlined.
3. The role of algorithms in problem solving is described as helping to evaluate if a problem can be solved using a computer and identifying the steps, decisions, and variables needed for the problem.
This document is an application for a computer hardware and peripheral devices course submitted by Laiba Mukhtar. It defines computer hardware as the physical and tangible parts of a computer system, including both internal components like the CPU, motherboard, and RAM, as well as external peripherals like monitors, keyboards, and printers. The document then categorizes computer hardware into internal hardware installed inside the computer case and external hardware installed outside. It provides examples for each category and defines peripheral devices as sensors used to input instructions and output processed data, dividing them into input devices, output devices, and storage devices.
The document discusses the steps involved in program development including defining the problem, outlining the solution, developing an algorithm, testing the algorithm, coding the algorithm, running the program, and documenting the program. It also discusses different approaches to program design such as procedure-driven, event-driven, and data-driven designs. Finally, it introduces algorithms, pseudocode, program data types, and how to write pseudocode using basic computer operations like arithmetic, assignment, comparison, and repetition.
Hardware devices can be categorized as input, output, or storage. Internal hardware includes the central processing unit (CPU), motherboard, random access memory (RAM), read only memory (ROM), graphics card, and sound card. The CPU processes data and runs instructions. The motherboard connects components. RAM stores active programs and data, while ROM permanently stores basic instructions. External devices include monitors, keyboards, mice, printers, and cameras. Storage devices like hard disk drives and solid state drives non-volatile store data on a storage medium.
This document provides an introduction to information technology concepts. It defines IT as using technologies like computing, electronics, and telecommunications to process and distribute digital information. It also discusses computer literacy and the basic components of a computer system, including hardware like the CPU, memory, input/output devices, and storage. The document also covers software types like operating systems and applications. It provides examples of common system software tasks and operating systems for different device types.
The document discusses algorithm design. It defines an algorithm as a step-by-step solution to a mathematical or computer problem. Algorithm design is the process of creating such mathematical solutions. The document outlines several approaches to algorithm design, including greedy algorithms, divide and conquer, dynamic programming, and backtracking. It also discusses graph algorithms, flowcharts, and the importance of algorithm design in solving complex problems efficiently.
Introduction to Computing - Essentials of Technology - Day 1Mark John Lado, MIT
- Familiarize yourself with characteristics of computers
- Identify the basic components of a computer
- Explain the importance of various units of a computer
- Differentiate between system software and application software
- Explain the importance of operating system
- Know the internal parts of the system unit.
- Get acquainted in the elements of computer system.
This document provides an introduction to computers and their components. It defines what a computer is and explains that it consists of input, processing, output and storage devices. It describes common input devices like keyboards and mice and output devices like monitors and printers. It then explains the different types of computers from microcomputers to mainframes and supercomputers. It discusses the internal components of a computer including the CPU, memory and storage devices. Finally, it outlines some common uses of computers and provides a brief history.
This chapter discusses databases and database management systems. It defines what a database is, including tables, fields, records and keys. It describes important database concepts like data integrity, security and privacy. It also covers different database classifications, models and how databases are commonly used on the web. The relational model is highlighted as the most widely used today for organizing data in tables related by common fields.
This document is an application for a computer hardware and peripheral devices course submitted by Laiba Mukhtar. It defines computer hardware as the physical and tangible parts of a computer system, including both internal components like the CPU, motherboard, and RAM, as well as external peripherals like monitors, keyboards, and printers. The document then categorizes computer hardware into internal hardware installed inside the computer case and external hardware installed outside. It provides examples for each category and defines peripheral devices as sensors used to input instructions and output processed data, dividing them into input devices, output devices, and storage devices.
The document discusses the steps involved in program development including defining the problem, outlining the solution, developing an algorithm, testing the algorithm, coding the algorithm, running the program, and documenting the program. It also discusses different approaches to program design such as procedure-driven, event-driven, and data-driven designs. Finally, it introduces algorithms, pseudocode, program data types, and how to write pseudocode using basic computer operations like arithmetic, assignment, comparison, and repetition.
Hardware devices can be categorized as input, output, or storage. Internal hardware includes the central processing unit (CPU), motherboard, random access memory (RAM), read only memory (ROM), graphics card, and sound card. The CPU processes data and runs instructions. The motherboard connects components. RAM stores active programs and data, while ROM permanently stores basic instructions. External devices include monitors, keyboards, mice, printers, and cameras. Storage devices like hard disk drives and solid state drives non-volatile store data on a storage medium.
This document provides an introduction to information technology concepts. It defines IT as using technologies like computing, electronics, and telecommunications to process and distribute digital information. It also discusses computer literacy and the basic components of a computer system, including hardware like the CPU, memory, input/output devices, and storage. The document also covers software types like operating systems and applications. It provides examples of common system software tasks and operating systems for different device types.
The document discusses algorithm design. It defines an algorithm as a step-by-step solution to a mathematical or computer problem. Algorithm design is the process of creating such mathematical solutions. The document outlines several approaches to algorithm design, including greedy algorithms, divide and conquer, dynamic programming, and backtracking. It also discusses graph algorithms, flowcharts, and the importance of algorithm design in solving complex problems efficiently.
Introduction to Computing - Essentials of Technology - Day 1Mark John Lado, MIT
- Familiarize yourself with characteristics of computers
- Identify the basic components of a computer
- Explain the importance of various units of a computer
- Differentiate between system software and application software
- Explain the importance of operating system
- Know the internal parts of the system unit.
- Get acquainted in the elements of computer system.
This document provides an introduction to computers and their components. It defines what a computer is and explains that it consists of input, processing, output and storage devices. It describes common input devices like keyboards and mice and output devices like monitors and printers. It then explains the different types of computers from microcomputers to mainframes and supercomputers. It discusses the internal components of a computer including the CPU, memory and storage devices. Finally, it outlines some common uses of computers and provides a brief history.
This chapter discusses databases and database management systems. It defines what a database is, including tables, fields, records and keys. It describes important database concepts like data integrity, security and privacy. It also covers different database classifications, models and how databases are commonly used on the web. The relational model is highlighted as the most widely used today for organizing data in tables related by common fields.
This document discusses adding Wi-Fi connectivity to embedded systems using the inexpensive ESP8266 microcontroller module. It describes how the ESP8266 integrates Wi-Fi and TCP/IP networking protocols to allow microcontrollers to connect to the internet and transfer data. Programming the ESP8266 involves using AT commands or a more user-friendly LUA scripting language through the NodeMCU firmware. Example LUA code is provided to demonstrate setting up a Wi-Fi connection and making an HTTP request to a web server.
This document provides an overview of computer organization and assembly language concepts including the CPU, registers, memory, and system bus. It summarizes that the CPU contains an execution unit and bus interface unit, uses various registers like general purpose registers and segment registers to store and access data and memory addresses. It describes different types of memory like RAM, ROM, and cache, and how memory is organized into segments and addressed using segment:offset notation. It concludes with an explanation of the system bus that connects the CPU, memory, and I/O devices, and the types of data transfers that occur over the bus.
The document discusses the process of writing a computer program. It explains that programming involves breaking a problem down into a logical sequence of steps. There are two main phases: the problem-solving phase where the problem is analyzed and an algorithm is developed, and the implementation phase where the algorithm is translated into a programming language and tested. The process also includes a maintenance phase to modify the program as needed over time.
Here is an algorithm to determine which child stole the cookie:
1. Interview each child individually
2. Ask each child if they took a cookie
3. If the child says no, go to the next child
4. If the child says yes, that child is the cookie thief
5. If all children say no, no one has confessed - the cookie thief remains unknown
This uses a sequence structure to interview each child one by one, and a selection structure (if/then) to determine if the child confesses or moving on to the next child.
The document discusses algorithms and flowcharts. It defines an algorithm as a step-by-step procedure to solve a problem and get a desired output. Common algorithm categories include search, sort, insert, update, and delete operations on data structures. Flowcharts provide a graphical representation of an algorithm's steps and logic. The document presents examples of an algorithm to add two numbers and the benefits of algorithms and flowcharts, such as effective problem analysis, proper documentation, and efficient coding and debugging. It also notes potential disadvantages like complexity when logic is complicated and the need to redraw flowcharts during alterations.
Design and analysis of algorithms - Abstract ViewWaqas Nawaz
This document discusses the design and analysis of algorithms. It introduces algorithms and defines them as sets of rules to solve computational problems. It emphasizes the importance of both designing algorithms through techniques like divide-and-conquer as well as analyzing their performance through complexity analysis. The document provides examples of analyzing worst-case, best-case, and average-case runtime and uses an example algorithm to find the largest number in an array to demonstrate space and time analysis methods.
DISCLAIMER: This Presentation is made for educational purposes only.
Introduction to Computer Programming, Computer Language, History of Computer Language, Hierarchy of High-Level Languages, Algorithm, Data Types and Arduino
Check out this guide for flowchart symbols meaning explained. If you need to know which flowchart symbols to use, all standard shapes and their definitions are explained on this page.
An introduction to computers including:
- What a computer is and its basic functions of input, processing, output, and storage.
- The main internal components of a computer including the central processing unit, memory, input devices, output devices, and storage devices.
- Examples of input devices such as keyboards and mice, as well as output devices like printers and monitors. Common storage devices include hard drives, flash drives, CDs/DVDs.
- The different types of software including system software, application software, educational software, and entertainment software.
This document provides an overview of computers and their components. It discusses how computers are everywhere and defines computer literacy. The main components of a computer are described including the system unit, motherboard, processor, memory, storage devices, input/output devices, and communications devices. The document explains what software is and the different types including system software, application software, packaged software, and custom software. It discusses how the processing cycle works and what makes computers powerful tools.
This chapter discusses the components that make up a computer system unit. It describes the motherboard as the main circuit board that contains the processor, memory chips, and adapter cards. The processor, consisting of a control unit and arithmetic logic unit (ALU), interprets and carries out instructions through a machine cycle. Memory temporarily stores data and instructions in chips such as RAM and ROM. Various ports, buses, expansion slots allow components to interface and transfer data around the system unit. The amount of RAM needed depends on the intended applications but generally more is better for performance.
Main memory consists of storage locations that can be uniquely addressed and hold data in the form of words. The two main types of main memory are RAM and ROM. RAM is volatile and used to store running programs and data, while ROM is non-volatile and used for firmware like the bootstrap loader. Cache memory and processor registers provide even faster temporary storage than main memory to improve system performance. Virtual memory uses the hard disk as an extension of main memory when RAM is insufficient. The closer the storage is to the processor, the faster the access speed.
The document provides an overview of computers including:
1. Computers accept input, process data, store data, and produce output. They are electronic devices that can perform calculations quickly and accurately.
2. Computers have large memory, can be programmed for different tasks, and never get confused or tired like humans.
3. There are two main types of computers - analog and digital. Digital computers are now more common and represent data using binary numbers.
This document provides basic troubleshooting steps for common computer problems. It begins by having the user rule out simple causes like ensuring all cables are securely connected. It then covers troubleshooting hardware issues with components like monitors, mice/keyboards not working. Software problems discussed include programs freezing or error messages. Solutions involve restarting the system or closing unresponsive programs. For persistent issues, removing startup files or extensions in safe mode is suggested. Network troubleshooting includes checking cable connections and contacting an administrator. The document stresses that computers will inevitably experience errors given their complex nature.
This document discusses hardware and software components of computer systems. It defines hardware as the physical aspects like keyboards and monitors, and software as programs that operate computers. There are six categories of hardware including input, output, storage, CPU, telecommunications, and connecting devices. Software is divided into application software for specific tasks and system software that manages hardware interaction and supports applications. Examples of application software include word processors and spreadsheets, while operating systems are an example of system software.
The document provides guidance on basic computer troubleshooting, including checking connections, rebooting the computer, documenting error messages, and identifying recent changes that could be causing issues. It also includes tips for troubleshooting issues with new monitors, motherboards, hard drives, and other hardware. Common beep codes and their meanings are listed to help diagnose potential problems.
For most programming/scripting languages the concepts are all the same. The only thing that changes is the syntax in which it is written. Some languages may be easier to remember than others, but if you follow the basic guide line, it will make learning any programming language easier. This is in no way supposed to teach you everything about programming, just a general knowledge so when you do program you will understand what you are doing a little bit better.
The document discusses the differences between system software and application software. It defines system software as programs that enable application software to interact with hardware and control computer hardware. Application software is defined as end-user software that can be general purpose, meant for common tasks, or special purpose, meant for specific tasks. Examples are provided of operating systems, device drivers, and servers as system software and office suites, media players, ERP software and games as application software.
A flowchart is a diagram that represents an algorithm or process, showing the steps as boxes or shapes connected by arrows to show order. It is used to analyze, design, document or manage a process. Common types include document, data, system, and program flowcharts. Standard symbols are used to represent elements like processes, decisions, data, and connections between steps. Examples show flowcharts for solving an equation and displaying numbers between 1 and 10. Flowcharts provide an overview of a process in a concise visual format.
The document discusses algorithms, providing definitions and examples of algorithms including Euclid's algorithm for computing the greatest common divisor. It also outlines properties that algorithms must have including finiteness, absence of ambiguity, defined sequence and inputs/outputs. Pseudocode is introduced as a way to express algorithms at a high level for human reading using basic logic structures like sequence, selection, and iteration.
Top-down design
Top Down Design Approach is one of several problem-solving approaches and is based on the dictum – “Divide and rule”. A small portion of problem is easier to solve at a time than the whole problem taken together. In this approach, the problem is broken down into smaller fragments and fragments, further into still smaller fragments till the fragments are small enough to be solved easily are separately.
The top-down design approach is based on the fact that large problems become more manageable if they are divided into a number of smaller and simpler tasks, which can be tackled separately.
This document discusses the program development life cycle (PDLC) process for developing computer programs. It describes the 7 main steps in the PDLC as: 1) defining the problem, 2) task analysis, 3) designing, 4) testing algorithms, 5) coding, 6) testing and debugging programs, and 7) documentation and implementation. Key problem solving techniques discussed include algorithms, flowcharts, and pseudocode, which are used to logically solve problems and represent solutions before coding.
This document discusses adding Wi-Fi connectivity to embedded systems using the inexpensive ESP8266 microcontroller module. It describes how the ESP8266 integrates Wi-Fi and TCP/IP networking protocols to allow microcontrollers to connect to the internet and transfer data. Programming the ESP8266 involves using AT commands or a more user-friendly LUA scripting language through the NodeMCU firmware. Example LUA code is provided to demonstrate setting up a Wi-Fi connection and making an HTTP request to a web server.
This document provides an overview of computer organization and assembly language concepts including the CPU, registers, memory, and system bus. It summarizes that the CPU contains an execution unit and bus interface unit, uses various registers like general purpose registers and segment registers to store and access data and memory addresses. It describes different types of memory like RAM, ROM, and cache, and how memory is organized into segments and addressed using segment:offset notation. It concludes with an explanation of the system bus that connects the CPU, memory, and I/O devices, and the types of data transfers that occur over the bus.
The document discusses the process of writing a computer program. It explains that programming involves breaking a problem down into a logical sequence of steps. There are two main phases: the problem-solving phase where the problem is analyzed and an algorithm is developed, and the implementation phase where the algorithm is translated into a programming language and tested. The process also includes a maintenance phase to modify the program as needed over time.
Here is an algorithm to determine which child stole the cookie:
1. Interview each child individually
2. Ask each child if they took a cookie
3. If the child says no, go to the next child
4. If the child says yes, that child is the cookie thief
5. If all children say no, no one has confessed - the cookie thief remains unknown
This uses a sequence structure to interview each child one by one, and a selection structure (if/then) to determine if the child confesses or moving on to the next child.
The document discusses algorithms and flowcharts. It defines an algorithm as a step-by-step procedure to solve a problem and get a desired output. Common algorithm categories include search, sort, insert, update, and delete operations on data structures. Flowcharts provide a graphical representation of an algorithm's steps and logic. The document presents examples of an algorithm to add two numbers and the benefits of algorithms and flowcharts, such as effective problem analysis, proper documentation, and efficient coding and debugging. It also notes potential disadvantages like complexity when logic is complicated and the need to redraw flowcharts during alterations.
Design and analysis of algorithms - Abstract ViewWaqas Nawaz
This document discusses the design and analysis of algorithms. It introduces algorithms and defines them as sets of rules to solve computational problems. It emphasizes the importance of both designing algorithms through techniques like divide-and-conquer as well as analyzing their performance through complexity analysis. The document provides examples of analyzing worst-case, best-case, and average-case runtime and uses an example algorithm to find the largest number in an array to demonstrate space and time analysis methods.
DISCLAIMER: This Presentation is made for educational purposes only.
Introduction to Computer Programming, Computer Language, History of Computer Language, Hierarchy of High-Level Languages, Algorithm, Data Types and Arduino
Check out this guide for flowchart symbols meaning explained. If you need to know which flowchart symbols to use, all standard shapes and their definitions are explained on this page.
An introduction to computers including:
- What a computer is and its basic functions of input, processing, output, and storage.
- The main internal components of a computer including the central processing unit, memory, input devices, output devices, and storage devices.
- Examples of input devices such as keyboards and mice, as well as output devices like printers and monitors. Common storage devices include hard drives, flash drives, CDs/DVDs.
- The different types of software including system software, application software, educational software, and entertainment software.
This document provides an overview of computers and their components. It discusses how computers are everywhere and defines computer literacy. The main components of a computer are described including the system unit, motherboard, processor, memory, storage devices, input/output devices, and communications devices. The document explains what software is and the different types including system software, application software, packaged software, and custom software. It discusses how the processing cycle works and what makes computers powerful tools.
This chapter discusses the components that make up a computer system unit. It describes the motherboard as the main circuit board that contains the processor, memory chips, and adapter cards. The processor, consisting of a control unit and arithmetic logic unit (ALU), interprets and carries out instructions through a machine cycle. Memory temporarily stores data and instructions in chips such as RAM and ROM. Various ports, buses, expansion slots allow components to interface and transfer data around the system unit. The amount of RAM needed depends on the intended applications but generally more is better for performance.
Main memory consists of storage locations that can be uniquely addressed and hold data in the form of words. The two main types of main memory are RAM and ROM. RAM is volatile and used to store running programs and data, while ROM is non-volatile and used for firmware like the bootstrap loader. Cache memory and processor registers provide even faster temporary storage than main memory to improve system performance. Virtual memory uses the hard disk as an extension of main memory when RAM is insufficient. The closer the storage is to the processor, the faster the access speed.
The document provides an overview of computers including:
1. Computers accept input, process data, store data, and produce output. They are electronic devices that can perform calculations quickly and accurately.
2. Computers have large memory, can be programmed for different tasks, and never get confused or tired like humans.
3. There are two main types of computers - analog and digital. Digital computers are now more common and represent data using binary numbers.
This document provides basic troubleshooting steps for common computer problems. It begins by having the user rule out simple causes like ensuring all cables are securely connected. It then covers troubleshooting hardware issues with components like monitors, mice/keyboards not working. Software problems discussed include programs freezing or error messages. Solutions involve restarting the system or closing unresponsive programs. For persistent issues, removing startup files or extensions in safe mode is suggested. Network troubleshooting includes checking cable connections and contacting an administrator. The document stresses that computers will inevitably experience errors given their complex nature.
This document discusses hardware and software components of computer systems. It defines hardware as the physical aspects like keyboards and monitors, and software as programs that operate computers. There are six categories of hardware including input, output, storage, CPU, telecommunications, and connecting devices. Software is divided into application software for specific tasks and system software that manages hardware interaction and supports applications. Examples of application software include word processors and spreadsheets, while operating systems are an example of system software.
The document provides guidance on basic computer troubleshooting, including checking connections, rebooting the computer, documenting error messages, and identifying recent changes that could be causing issues. It also includes tips for troubleshooting issues with new monitors, motherboards, hard drives, and other hardware. Common beep codes and their meanings are listed to help diagnose potential problems.
For most programming/scripting languages the concepts are all the same. The only thing that changes is the syntax in which it is written. Some languages may be easier to remember than others, but if you follow the basic guide line, it will make learning any programming language easier. This is in no way supposed to teach you everything about programming, just a general knowledge so when you do program you will understand what you are doing a little bit better.
The document discusses the differences between system software and application software. It defines system software as programs that enable application software to interact with hardware and control computer hardware. Application software is defined as end-user software that can be general purpose, meant for common tasks, or special purpose, meant for specific tasks. Examples are provided of operating systems, device drivers, and servers as system software and office suites, media players, ERP software and games as application software.
A flowchart is a diagram that represents an algorithm or process, showing the steps as boxes or shapes connected by arrows to show order. It is used to analyze, design, document or manage a process. Common types include document, data, system, and program flowcharts. Standard symbols are used to represent elements like processes, decisions, data, and connections between steps. Examples show flowcharts for solving an equation and displaying numbers between 1 and 10. Flowcharts provide an overview of a process in a concise visual format.
The document discusses algorithms, providing definitions and examples of algorithms including Euclid's algorithm for computing the greatest common divisor. It also outlines properties that algorithms must have including finiteness, absence of ambiguity, defined sequence and inputs/outputs. Pseudocode is introduced as a way to express algorithms at a high level for human reading using basic logic structures like sequence, selection, and iteration.
Top-down design
Top Down Design Approach is one of several problem-solving approaches and is based on the dictum – “Divide and rule”. A small portion of problem is easier to solve at a time than the whole problem taken together. In this approach, the problem is broken down into smaller fragments and fragments, further into still smaller fragments till the fragments are small enough to be solved easily are separately.
The top-down design approach is based on the fact that large problems become more manageable if they are divided into a number of smaller and simpler tasks, which can be tackled separately.
This document discusses the program development life cycle (PDLC) process for developing computer programs. It describes the 7 main steps in the PDLC as: 1) defining the problem, 2) task analysis, 3) designing, 4) testing algorithms, 5) coding, 6) testing and debugging programs, and 7) documentation and implementation. Key problem solving techniques discussed include algorithms, flowcharts, and pseudocode, which are used to logically solve problems and represent solutions before coding.
The document provides an overview of problem solving techniques in computer science. It discusses:
- Algorithms and programs as solutions to problems expressed in programming languages.
- Key aspects of problem solving including problem definition, getting started, working backwards, and utilizing past experiences.
- General problem solving strategies such as "divide and conquer" and dynamic programming.
- Algorithm design techniques like top-down design and choosing appropriate data structures.
- Implementing algorithms through modularization, variable naming, documentation, debugging, and testing.
- Verifying algorithms through input/output assertions, symbolic execution, and proving program segments.
- Analyzing algorithm efficiency by reducing redundant computations, early termination detection, and trading storage for
This document provides an overview of problem solving and Python programming. It discusses computational thinking and problem solving, including identifying computational problems, algorithms, building blocks of algorithms, and illustrative problems. It also discusses algorithmic problem solving techniques like iteration and recursion. Finally, it briefly introduces the course titled "GE8151-PROBLEM SOLVING AND PYTHON PROGRAMMING".
The document discusses problem solving using computers, describing how problem solving involves defining the problem, developing an algorithm to solve it, and implementing that algorithm as a computer program. It outlines the key steps in problem solving as analyzing the problem, developing an algorithm using tools like flowcharts and pseudocode, coding the algorithm, and testing and debugging the program. Proper problem analysis and algorithm development are emphasized as critical to producing the correct output through a computer program.
Operations research (OR) is an interdisciplinary approach for decision-making that uses mathematical modeling and analytical methods to arrive at optimal or near-optimal solutions to complex decision problems. OR was first applied during World War II to solve logistics and operations problems. It involves breaking problems down into components, representing them mathematically, and using analytical methods like linear programming to solve problems. The goal of OR is to determine the best solution to a problem by quantifying variables and using mathematical techniques and computer modeling.
This document outlines an assignment to analyze and design a program for sequential control flow. The objectives are to understand computational problem solving, sequential logic, and how to create IPO charts, algorithms, and flow charts. As an example, students are instructed to create these analysis tools to solve a temperature conversion problem that takes Celsius input and outputs Fahrenheit and Kelvin scales using defined formulas. The document provides background on problem solving techniques, sequential control flow, and common analysis tools like IPO charts, algorithms using pseudocode, and flow charts using standard symbols.
The document outlines the steps involved in program design and problem solving techniques, including defining the problem, outlining the solution, developing an algorithm using pseudocode, testing the algorithm, coding the algorithm, running and documenting the program. It also discusses algorithmic problem solving, the structure theorem, meaningful naming conventions, communication between modules through variables and parameters, module cohesion and coupling, and sequential file updates.
1. The document introduces computer programming and discusses its importance in modern society. It touches on how computers have evolved to become indispensable tools that help solve problems across many domains.
2. It outlines the typical steps involved in programming: problem analysis, algorithm development, coding, testing and debugging. Key aspects like problem definition, input/output determination, and logical processing of data are important parts of problem analysis.
3. The document emphasizes that programming requires both logic and creativity to develop well-designed solutions. Proper documentation is also important for program maintenance and future modifications.
This document outlines the grading structure, textbooks, and key concepts for an applied programming course in Python. It discusses the following main points:
- Grading is based on quizzes, assignments, a project, class participation, midterm, and final exam.
- The programming process involves 5 main steps: defining the problem, planning the solution, coding, testing, and documenting. Common planning tools include top-down design, algorithms, and flowcharts.
- Programming constructs allow for sequential, conditional, and repetitive control structures to structure program logic and flow. These include if/else statements, loops, and functions.
Introduction
The term problem solving is used in many disciplines, sometimes with different perspectives and
often with different terminologies. The problem-solving process starts with the problem
specification and end with a correct program.
The steps to follow in the problem-solving process are:
Problem definition
Problem Analysis
Algorithm development
Coding
Testing & Debugging
Documentation & Maintenance
The stages of analysis, design, programming, implementation and maintenance form the life cycle
of the system.
This document provides an overview of principal component computing fundamentals, including programming processes, algorithms, and flowcharts. It discusses developing programs, the program development life cycle with 6 phases, characteristics of algorithms, categories of algorithms, writing algorithms, guidelines for preparing flowcharts, and benefits of flowcharts. The document is intended to introduce fundamental concepts related to programming, algorithms, and using flowcharts to represent processes and algorithms.
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESHarshJha34
The document discusses various topics related to unit 1 of a programming course, including flowcharts, algorithm design using top-down and bottom-up approaches, and pseudocode. It covers elements of flowcharts like input/output, branching, and iteration. It describes problem solving in two phases - problem solving and implementation. It also explains algorithm development, properties of algorithms, and constructs like sequence, decision, and iteration. Pseudocode representation and writing pseudocode from algorithms and flowcharts is also mentioned.
Problem Solving Techniques and Introduction to CPrabu U
This document provides an overview of problem solving techniques, programs, and the program development cycle. It discusses:
1. The steps of problem solving techniques include defining the problem, formulating a mathematical model, developing an algorithm using a flowchart or pseudocode, writing code, and testing the program.
2. A program consists of a series of instructions and fixed data to perform required operations. The program development cycle involves problem analysis, design, coding, compilation and execution, debugging and testing, and documentation.
3. An algorithm is a finite sequence of steps to solve a problem. Flowcharts use graphical symbols to represent the steps of an algorithm and show the program logic through connections between these symbols.
1 Saint Leo University GBA 334 Applied Decision.docxaryan532920
The film The Godfather explores the theme of revenge. When Michael Corleone's father Vito is attacked, Michael seeks revenge by killing the ones responsible. This act of vengeance draws Michael deeper into the family crime business. Throughout the film, Michael takes revenge on anyone who wrongs or betrays his family, solidifying his role as the new head of the crime family. Cinematography in The Godfather features unique shots and scenes that helped introduce new techniques to films.
Algorithm for computational problematic sitSaurabh846965
A computer requires precise instructions from a user in order to perform tasks correctly. It has no inherent intelligence or ability to solve problems on its own. For a computer to solve a problem, a programmer must break the problem down into a series of simple steps and write program code that provides those step-by-step instructions in a language the computer can understand. This process involves understanding the problem, analyzing it, developing a solution algorithm, and coding the algorithm so the computer can execute it. Flowcharts can help visualize algorithms and problem-solving logic in a graphical format before writing program code.
This document introduces DePathos, a graphical tool that helps users solve large timetabling problems using a constraint-based timetabling engine called Pathos. DePathos takes a systematic, incremental approach to solving problems. It partitions large problems into subproblems, solves the subproblems independently, then incrementally combines the solutions. This helps identify inconsistencies earlier. DePathos also allows users to structure problems hierarchically based on the domain, and direct the solving process to find partial solutions that are meaningful in practice. The document describes the components of DePathos and how its incremental solving process works. It explains how DePathos helps address issues like finding inconsistencies when using Pathos for real-world timetabling
The document discusses the phases and steps of the software development process. It begins with defining a program and explaining that writing a program is the last step after determining the problem and solution method. There are typically three phases: development and design, documentation, and maintenance. The development and design phase consists of four steps - analyzing the problem, developing a solution algorithm, coding the solution, and testing and correcting the program. The goal of software engineering is to create programs and systems that are readable, efficient, reliable, and maintainable.
The document discusses the concepts of programs and algorithms. It defines a program as a group of sequential statements that are executed line by line to achieve a goal. An algorithm is described as a step-by-step process that precisely defines a sequence of operations to solve a computational problem. The document also outlines the key components of a programming language, characteristics of good programs, stages of the program development process, and provides examples of algorithms.
The document outlines the objectives and contents of the course GE3151 Problem Solving and Python Programming. The objectives include understanding algorithmic problem solving, solving problems using Python conditionals and loops, defining functions, and using data structures like lists, tuples and dictionaries. The course is divided into 5 units which cover topics like computational thinking, Python data types and expressions, control flow and functions, lists and tuples, files and modules. Some illustrative problems mentioned are finding the minimum in a list, solving towers of Hanoi problem, calculating distance between two points, checking voter eligibility, and preparing a retail bill.
Similar to Csc 102 lecture note(introduction to problem solving) (20)
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Build a Module in Odoo 17 Using the Scaffold Method
Csc 102 lecture note(introduction to problem solving)
1. 1 | P a g e
FEDERAL UNIVERSITY, NDUFU-ALIKE IKWO
(FUNAI)
FACULTY OF SCIENCE
DEPARTMENT OF MATHEMATICS/COMPUTER
SCIENCE/STATISTICS/INFORMATICS
CSC 102: INTRODUCTION TO PROBLEM
SOLVING
(LECTURE NOTE)
PROGRAM TEAM MEMBERS
Chizoba C. Nnamene (Course Coordinator)
Ikenna Ezea
2. 2 | P a g e
COURSE DESCRIPTION
This course is designed to equip the student with the skills needed to solve problem in a broad
range of fields. It lays more emphases on the appropriate problem solving skills a computer
scientist or a programmer may need for the execution of variable range of tasks.
After the completion of this course, the student is expected to know the following problems solving
concepts:
Problem solving strategies
Role of algorithm in problem solving process
Implementation strategies
Concepts of algorithm
Properties of algorithm
Prerequisite: A background in CSC 101: Introduction to computer science or any other related
course(s) is essential.
The course description at a glance
Course content Section
Problem solving strategies See section 1.1
Concepts of algorithm See section 1.2
Properties of algorithm See section 1.2.2
Role of algorithm in problem solving process See section 1.2.3
Implementation strategies See section 2.1
3. 3 | P a g e
CONTENTS
1.0 Introduction 4
1.1. General Problem Solving Strategies 4
1.2. Concepts of Algorithm 5
1.2.1. Major Components of Algorithm 6
1.2.2. Properties of Algorithm 6
1.2.3. Role of Algorithm in Problem Solving 7
1.2.4. Ways of expressing Algorithm 7
1.2.5. Algorithm Development Methodologies 8
1.2.5.1. Top-Down Design 8
1.2.5.2. Object Oriented Design 9
2.1 Implementations strategies 9
2.1.1. Specify the problem requirements (Requirement Specification). 10
2.1.2. Analyze the problem (Analysis) 10
2.1.3. Design the algorithm to solve the problem (Design). 11
2.1.4. Implement the algorithm (Implementation). 11
2.1.5. Test and verify the completed program (Testing). 11
2.1.6. Maintain and update the program (Maintenance). 11
2.2. Applications of Software Development Methods in Problem Solving 12
CASE STUDY I: Temperature conversion 12
USE CASE II: Volume calculation 16
Summary 19
Exercises 20
References 21
4. 4 | P a g e
1.0. Introduction
Problem solving is a compound word that is composed of two words, “Problem” and
“Solving”. For us to give a definition we need to take the words into context. Depending
on the context, problem has been defined in a number of ways. The dictionary definition
holds that problem is a question raised for inquiry, consideration or solution, in
mathematics problem has been defined as a situation that is to be resolved using well-
defined mathematical principles. Solving on the other hand can be defined as a means of
finding solution to a problem.
Based on the above definitions we can formally define problem solving as the act of
finding a solution to perplexing, distressing, vexing or unsettled question. Though the
definition of problems cited in the first paragraph suits this definition, some of them are
not suitable in the context of computing. This is because computers are limited in its
problem solving capabilities. Computers cannot be used in solving problems involving
physical activities or emotions. Such as resolving marital problems, providing solutions to
the age long problems between Catholics and Protestants, squeezing passengers in an
overloaded bus, or the religious conflict between Muslims and Christians in Nigeria. A
computer can be considered as an unintelligent device in that it cannot act unless when
instructed to do so. It cannot analyze and proffer a solution to a problem without the
programmer performing the analysis and providing the instructions in form of a program,
which is fed into the computer in other to carry out the designated task.
However, once a problem has been analyzed and instruction translated into program the
computer has the ability to carry out the processing in a very fast, repeated and consistent
manner for different data entry and variable situations. Computer helps people in the
computation of repeated and boring tasks, thereby saving time and effort required to carry
out the tasks. Computers can be used for registration of courses, administering of
examinations and marking of scripts, financial management and budgeting, etc.
1.1. General Problem Solving Strategies
To solve a problem one has to understand the problem domain and the situation to avoid
mistakes or incorrect assumptions. To be a better problem solver we need to have a good
understanding of the general problem-solving framework. One of the frameworks is the
one outlined by Polya in his book “How to solve it”. This problem solving approach even
though was written for mathematical problem solving it has been widely adopted in
computing and many other problem solving domains. The four Polya’s problem solving
strategies are:
1. Understanding the problem: Carefully read the problem to understand what needs to
be accomplished. Assess your background skills in the area under consideration to
know if you have to acquire more skills in other to solve the problem. Visualize the
final-result and use it as a guide in determining the validity of your solution and the
result that will be obtained. Identify the known and the unknown (variables). Check the
data and the conditions that needs to be satisfied. Check to know if the condition is
5. 5 | P a g e
sufficient to determine the unknown. Split the problem into parts and write down the
parts.
2. Device a plan: Check to see if there is a link between the data and the unknown
(variable), if there is no link then try using auxiliary problem. Check if a similar
problem exists so you can adapt the solution instead of reinventing the wheel. After all,
the outcome of this phase is the plan of the solution.
3. Carrying out the plan: In carrying out the plan, you have to go through the steps to
know if they are correct, ascertain if there is any missing link. Check if the correctness
of the plan can be proved. If the plan does not work correctly, discard it and try another
plan.
4. Looking Back: This is the moment of reflection. This is the phase that you can
crosscheck what you have done to arrive at the present stage. In this phase, you can
ascertain what worked and what did not work. This is the time your argument and
results are verified for correctness and consistency. In this phase, you can check if the
solution can be applied in other problems. At this point, you can also ascertain if you
can still get the same result using different methods.
1.2. Concepts of Algorithm
Problem solving as we have seen involves the abstraction and decomposition of large
amount of problem into smaller manageable subtasks that can be handled independently.
An algorithm is important in the planning and execution of a problem solution since it
specifies the sequence of steps needed to carry out the instructions that will lead to the
overall result. An algorithm can be defined as a sequential set of instructions that are
followed in other to solve a problem using a finite amount of data in a finite amount of
time. More than one algorithm can be written for a particular problem (see figure 1.0) but
the choice of selecting a particular algorithm in place of the other is dependent on the
following factors: reliability, accuracy, ease of modification and time required for the
execution when converted to a high-level language.
Figure 1.0: Relationship between Problem, Algorithms and Programs
6. 6 | P a g e
1.2.1. Major Components of Algorithm
Most of the algorithms used in solving program related problems consist of three major
sections: the input, processing and output. That is the summary of most if not all the
activities undertaken by most algorithm in other to produce a result. To execute a task
the algorithm requires some data (i.e. input), it performs some computation on the data
(i.e. processing) then it produces result (i.e. output). The processing comprises of any
or all of the following: computation, selection, iteration, etc. Figure 1.1. Shows the
three major sections of an algorithm.
Figure 1.1: The three major sections of an Algorithm
Input: This represent the data that is to be sent for processing in the system. Most
algorithms provides some variables and the description of the data that the variable will
handle.
Processing: This is the action performed on data in other to produce the desired result.
Such actions like computation, selection, iteration, etc.
Output: This is the result produced after the data has been processed. When the algorithm
has been converted to programs, the data is usually displayed through the output device,
for example the monitor.
1.2.2. Properties of Algorithm
a. Finiteness: An algorithm should be able to terminate after a finite number of
instructions must have been processed. That means it does not have to take forever to
process a set of instructions.
b. Definiteness: The algorithm should be developed in a form that each step will be
precise and easy to understand.
c. Effectiveness: This means that the algorithm should be in a form that will be easy to
convert to a programming statement in a finite amount of time.
d. Generality: The algorithm should be able to produce the same output when given
different type of valid data (i.e. data taking from a specified domain).
e. Input/output: The algorithm should be able to produce output value(s) when given a
set of specified input value(s). There should be a relationship between the input and the
output produced by the algorithm.
7. 7 | P a g e
1.2.3. Role of Algorithm in Problem Solving
a. Algorithm helps in the evaluation of a problem to know if it can be solved using a
computer. Once an algorithm can be written for a problem then the problem can be
solved using computational means.
b. Algorithm helps in the identification of the various steps, major decision points and the
variables needed to solve a problem. This are the concepts that are needed for the
development of a computer program.
c. Algorithm helps in the decomposition of a large task into small manageable subtasks.
The decomposition helps in reducing the complexity of the problem and make it
solvable.
d. The atomic nature of the tasks/subtasks of the algorithm makes the decision making
process more rational in nature, since the subtasks are supported by facts.
e. Given different tasks, one algorithm can be applied in performing all the tasks. This
enhances the consistency and reliability of the problem solving process.
1.2.4. Ways of expressing Algorithm
The expression of algorithm can come in three major ways. They are:
Natural Language: This is a method of expressing algorithm using our day-to-day
language, like English or other languages. This has been found to be
disadvantageous as it is very wordy and confusing.
Example 1.1: Write an algorithm in natural language to calculate the area of a
triangle (area = ½ * base * height)
Solution
Step 1: Start
Step 2: Select from the triangle the values for base and height
Step 3: Calculate the product of the values (i.e. base and height)
Step 4: Divide the product of base and height by 2
Step 5: The area is the result gotten after dividing base and height
by 2
Step 6: Stop
Pseudo Code: This type of expression has a form that is closely related to a
programming language though there is no restriction on the syntax. It is not
ambiguous like the natural language.
Example 1.2: Write a pseudo code to calculate the area of a triangle
Solution:
Step 1: Start
Step 2: Read base and height
Step 3: Product = base x height
Step 4: Area = product/2
Step 5: Print Area
Step 6: Stop
8. 8 | P a g e
Flow chart: Uses symbols to represent the sequence of instructions. It is not
ambiguous like the natural language, but the modification is done using a
specialized tool. In addition, the implementation uses a standard rules.
Example 1.1: Draw a flowchart to calculate the area of a triangle (area = ½ * base
* height)
Solution:
1.2.5. Algorithm Development Methodologies
Algorithm development can be approached using the following methodologies: Top-
Down Design (functional decomposition) and Object Oriented Design. We will
proceed with the explanation of top-down design in the next section, after that we will
explain Object Oriented Design.
1.2.5.1. Top-Down Design
The most common problem solving approach that is used among humans is divide and
conquer, which means dividing a large problem into smaller parts that can be solved
independently. This is the concept used in Top-Down Design. Top-down design,
which is also called functional decomposition, is a problem solving methodology that
involves splitting a large problem into smaller manageable parts that can be solved
independently and integrated to form the overall solution. The problems in a top-down
design are arranged in a hierarchical tree structure (structured chart), consisting of
problems or sub problems called modules. A module is a self-contained set of steps
needed for the solution of a problem. The modules are arranged in a hierarchy from top
to the bottom in a structure chart. The module at the top is the main problem while the
once at the bottom is a sub division of the problem. The modules are numbered
according to their position in the hierarchy; those in the same level are given the same
number. The numbering starts from top, which is usually zero, down to the bottom,
which can be any finite number, depending on the problem.
The reason for the division of the problems into modules, parts, or segments is to reduce
the complexity of the problem by sub dividing them into smaller manageable
independent parts. In the context of computer science, the responsibility of the module
9. 9 | P a g e
depends on the requirement of the problem. Some of the module(s) could be
responsible for data input, some may perform processing of data, this may involve;
mathematical, logical or relational operation, while some may be responsible for the
output.
As an example, let us refer to figure 2.1. The figure is a hierarchical tree structure
(structured chart) that consist of three levels (level 0, 1, 2, and 3) the top level or level
0 describes the function of the overall problem. It is the abstract step because the
problems at this level can further be decomposed into smaller sub problems in the levels
that follows. The last module at the bottom (i.e. the module at level 3), that cannot be
decomposed any further is called the concrete step. Refer to case study II to see a
detailed example of dot-down design methodology.
Figure 2.1: An illustration of top-down design using a structured chart
1.2.5.2. Object Oriented Design
2.1 Implementations strategies
In section 1.1, we introduced general problem solving strategies using Polya’s approach.
In this section, we are going to limit our conversation to computer-based problem solving
strategy. Problem solving is an activity undertaken in every programming or software
development environment, so it is an indispensable knowledge needed by every
programmer or software developer. Problem solving is not just limited to computer
scientists, or programmers, it is also used by business students, engineers and scientists
though in a different way. In business studies, students use systems approach, while in
engineering and science, the engineers and scientists use engineering and scientific method
respectively, the programmers on the other hand use software development approach, and
10. 10 | P a g e
that is going to be our topic of discussion in this section. The software development
methods are as follows:
2.1.1.Specify the problem requirements (Requirement Specification).
This involves a critical examination of the posed problem so, as to get a better
understanding of the requirement needed to solve the problem. The problem is restated and
every unimportant aspects are eliminated at this point. This is to help in presenting the
problem in a clear and unambiguous form.
2.1.2.Analyze the problem (Analysis)
The identification of the input variables (i.e. the data) needed for the implementation of the
problem is done at this point. The expected output (i.e. the result) that is to be obtained
after the execution of the input data and the formats (example a table with heading, rows
and columns) of presenting the result are also identified. The use of formulas or other
methods as a means of expressing the relationship that exists with the variables in the
problem is strongly encouraged. It is important to note that if the first step and this second
step is not carried out properly, it will lead to error or failure in the solution. See example
2.1 for explanation of this phase.
Example 2.1:
Given the three sides and height of a triangle, calculate in centimeter the area and perimeter
of the triangle.
Problem Input
Three sides (side 1, side 2, side 3) of the triangle (in centimeter)
Height (h) of the triangle (in centimeter)
Problem Output
Area of the triangle
Perimeter of the triangle
Formula to identify the relationship between the input and output
Once we have been able to determine the input and output of the problem, then we can
establish a relationship between the input and output variables using formula(s).
Let the base = side3;
Perimeter = side1+side2+side3;
Area = ½ * base * h;
When solving a problem we extract those variables and relationship that are of interest
to us. The process of modelling a problem by extracting relevant information is known
as abstraction.
11. 11 | P a g e
2.1.3. Design the algorithm to solve the problem (Design).
This phase involves developing the sequence of steps called an algorithm that will be
followed in other to solve a given problem, and after all, a verification will be made to
know if the steps taken was able to solve the problem. It is usually advisable that top-down
design (or divide and conquer) approach be adopted in carrying out this task of algorithm
design and development. Using top-down design implies that the overall solution of the
problem will be realized by unifying all the steps followed and solutions obtained from the
sub modules. Some steps taken at each module might need to be expanded so that the
required details will be provided to adequately, solve the problem. This approach of
expanding the steps by providing additional detailed steps to a particular step is called
stepwise refinement. Let us examine how a lecturer develop his lecture note, he take up a
topic, break it down into sub topics (or course outline), then for each of the sub topics he
fills in some additional details that will enhance the understanding of the course. This
process of providing some additional details into a sub topic or course outline is an example
of stepwise refinement in top down design process.
After all the instructions and steps have been identified, it is important that we simulate the
computer execution process by going through the instructions step-by-step to verify that
all the steps in the design is behaving as intended. This process of simulating the computer
execution process by going through the algorithm step-by-step to detect and correct errors
is known as desk checking. Desk checking helps to detect error early during the algorithm
design. This will alleviate the overhead involved in detecting and correcting error later in
the program development or implementation phase.
2.1.4. Implement the algorithm (Implementation).
After the algorithm has been developed, the next step, which is the implementation of the
algorithm, is to convert every step in the algorithm to an equivalent statement in a
programming language. One algorithm can be implemented using one or more
programming language(s).
2.1.5. Test and verify the completed program (Testing).
Testing and verification involves executing the program in the computer to know if it is
producing the desired result. Testing phase is a very tedious task, as the program has to be
tested given different circumstances and data.
2.1.6. Maintain and update the program (Maintenance).
After the program has been tested, certified and put into productive use, it will be made to
work under different hardware, operating system, geographic locations, security
conditions, etc. and will be expected to deliver its task effectively and uninterruptedly. In
addition, the software is to adapt to changes in government/organizational policies. When
all these start happening the program starts malfunctioning, thereby deviating from the
originally intended task. So based on these there is need for regular or periodic maintenance
and update. This update will continue for a period of five years or more depending on the
organizational policies. During this time, the original developers may have left the
12. 12 | P a g e
company thereby entrusting the responsibility of the software maintenance on may not
have a good understanding of the software and can only be guided by the software
documentation. So based on this for the maintenance and update of a program to be
effective there is need for proper documentation at every point of software development
and maintenance. Maintenance and update is a means through which software are released
at interval to be installed in already existing software to improve its functionality, correct
faults, improve performance or address some security challenges.
2.2. Applications of Software Development Methods in Problem
Solving
In this section, we will be demonstrating how we can apply software development method
to problem solving.
CASE STUDY I: Temperature conversion
THE PROBLEM
You have been entrusted with the job of weather forecasting, and you have a device that
can only read temperature in Celsius and you are expected to report in Fahrenheit. Write a
program to convert every Celsius temperature reading recorded by your device to
Fahrenheit.
ANALYSIS
The first thing to do is to understand what is expected of you in the problem. The problem
says that you will be getting the Celsius temperature from your device, which will be
converted to Fahrenheit. Therefore, the input is Celsius and the output is Fahrenheit. In
this phase, we equally need to ascertain the relationship between the input and the output.
This can be established using the formula.
DATA REQUIREMENT
Required Input
Celsius /* the temperature in degree Celsius */
Product /* the result obtained after multiplying Celsius by 9/5 */
o Constants
SCALERATE = 9.0/5.0;
TEMPSCALE = 32;
13. 13 | P a g e
Required Output
Fahrenheit /* the temperature in degree Fahrenheit */
Required Formulas
Fahrenheit = (Celsius * 9/5) + 32
By substituting the constants SCALERATE for 9/5 and TEMPSCALE for 32 we
have
Fahrenheit = (Celsius * SCALERATE) + TEMPSCALE
DESIGN
The next step will be to formulate the algorithm by listing the sequence of steps needed to
execute the problem. Such steps are listed below:
ALGORITHM
Step 1: Start
Step 2: Read Celsius Temperature
Step 3: Convert Celsius to Fahrenheit
Step 4: Print Fahrenheit
Step 5: Stop
It is time to decide which step needs to be extended further so, as to convey more meaning
and enhance a better clarity. Step 1, 4 and 5 needs no refinement since it is just to start,
read Celsius temperature and display the temperature in Fahrenheit, but step 1 and 2 needs
more refinement like we will see shortly.
o Step 1 refinement
Step 1: Read Celsius Temperature
1.1: Write “Enter Celsius Temperature”
1.2: Read Celsius temperature
1.3: Press return key
o Step 2 refinement
Step 2: Convert Celsius to Fahrenheit
2.1: Fahrenheit = (Celsius * 9/2) + 32
ALGORITHM WITH REFINEMENT
Step 1: Start
Step 2: Read Celsius Temperature
2.1: Write “Enter Celsius temperature value”
14. 14 | P a g e
2.2: Press return key
2.3: Read Celsius temperature
Step 3: Convert Celsius to Fahrenheit
3.1: Fahrenheit = (Celsius * 9/2) + 32
Step 4: Print Fahrenheit
Step 5: Stop
Desk checking
Now that we are done with, the algorithm let us perform a desk check to know if the
algorithm is producing the desired result. See table 2.1. The table consists of four fields the
steps which represents the order of instruction execution, the operation which is responsible
for the actual processing of the instruction, the result displays the outcome of every step
and finally the status shows whether the instruction is given the desired result or not.
Because all the fields are labeled Ok then we conclude that everything is OK and we can
proceed to the next phase which. is implementation.
Step Operations Result Status
1 Algorithm starts here Algorithm starts OK
2 No operation required No result OK
2.1 Request for input User enters 20 from keyboard OK
2.2 Read 20 from keyboard 20 is assigned to Celsius OK
3 No operation required No result OK
3.1 Fahrenheit = (Celsius *9/2) +32 Fahrenheit = 68 OK
4 Print Fahrenheit = 68 Fahrenheit =68 is displayed on screen OK
5 Stop the algorithm Algorithm finishes and terminate OK
Table 2.1: A table to show the status of the desk checking operation
IMPLEMENTATION
After you have completed the design of the algorithm, the next step is to convert every step
of the algorithm to a valid statement in any of the programming languages, in our case C
language. To write the program you need to first state the kind of input (data) you are going
to use in the execution of the program, in our own case we want to use decimal numbers
(i.e. float). In addition, we would want to identify the data in the memory with the names
Celsius, and Fahrenheit. After which we will proceed with the statement that will execute
the main section of the algorithm, which is the section that does the conversion of the
temperature from Celsius to Fahrenheit, i.e. step 3.2 in the algorithm. Note that the
algorithm with the refinement is what you are going to convert not the one without
refinement.
15. 15 | P a g e
Listing 2.1 shows a C program implementation and the sample execution of the refined
algorithm in the Design section. We used statements to explain each step of the program.
For the purpose of brevity, we have deferred the detailed explanation of the program for
now; we will be discussing it in our next class.
/* ***********************************************
* Performs Celsius to Fahrenheit conversion *
************************************************/
#include<stdio.h> /* Definition for printf and Scanf */
void main(){ /* The program starts here */
/* declaration of input variables */
float Celsius;
float Product;
float Fahrenheit;
/* conversion constants */
const float SCALERATE = 9.0/5.0;
const float TEMPSCALE = 32;
/* Read input from keyboard */
printf("Enter Celsius temperature and press enter key when done ");
scanf("%f", &Celsius);
/* Calculate the Fahrenheit equivalent */
Fahrenheit = Celsius * SCALERATE + TEMPSCALE;
/* Print the result (output) of the conversion */
printf("n The Fahrenheit equivalent of n %.2f degree Celsius is %.2f n", Celsius,
Fahrenheit);
} /* The program ends here */
Listing 2.1: Program to convert Celsius temperature to Fahrenheit.
Sample output of the program
Enter Celsius temperature value and press enter key when done >> 20
The Fahrenheit equivalent of
20.00 degree Celsius is 68.00
16. 16 | P a g e
TESTING
Testing the program means verifying that the program will give the required output when
given a set of valid input data. You have to test the program by supplying it with a set of
valid input data and examining the data carefully to know if it corresponds with the
intended output. To be sure that the program is behaving well you have to test it with
variable input sets. In some cases, you might have to test how the program will behave if
given some unrelated input values. This has to be ascertained so that the program will not
crash when someone mistakenly put some unrelated input value(s).
USE CASE II: Volume calculation
THE PROBLEM
Given the radius and height of a cylinder, calculate the volume
ANALYSIS
From the problem, we can deduce that the solution will require two inputs the radius and
height of the cylinder then one output will be required which is the volume. The input
values will be of float (fractional) type, since the constant pie is of decimal type, which
will change the integer variable to be of fractional type. The relationship that exist between
the variables (i.e. the input and output) will be listed subsequently.
DATA REQUIREMENT
Required Constant
PI 3.14 /* the value of the constant PI */
Required Input
Radius /* the radius of the cylinder */
Height /* the height of the cylinder */
Area /* the area of the cylinder */
Required Output
Volume /* the volume of the cylinder */
Required Formulas
Area = PI * Radius * Radius
Volume = Area * Height
17. 17 | P a g e
DESIGN
ALGORITHM
Step 1: Start
Step 2: Get input
Step 3: Calculate volume
Step 4: Print volume
Step 5: Stop
o Step 2 refinement
2.1: Request for input
2.2: Read input
o Step 3 refinement
3.1: Area = PI * Radius * Radius
3.2: Volume = Area * Height
ALGORITHM WITH REFINEMENT
Step 1: Start
Step 2: Get input
2.1: Request for input
2.2: Read input
Step 3: Calculate volume
3.1: Area = PI * Radius * Radius
3.2: Volume = Area * Height
Step 4: Print volume
Step 5: Stop
The relationship between the original problem and its sub-problems (subtasks) can be
demonstrated using structured chart as show in figure 2.2. The algorithm and the structured
chart has the same sub-problem (subtask) though they differ in some ways, the algorithm
shows the sequence of steps to be followed to accomplish the task while the structured
chart only shows the subordination that exists between the main task and the rest of the
subtask and equally the relationships that exists between the modules.
18. 18 | P a g e
Figure 2.2: Structured chart to show the top-down model of the prison problem
.
Desk checking
Table 2.2 shows how we have manually executed the instructions written in the algorithm
to know if the algorithm we give the desired result.
Step Operations Result Status
1 Algorithm starts here Algorithm starts OK
2 No operation required No result OK
2.1 Request for input User enters 7 and 8 from keyboard OK
2.2 Read 7 and 8 from keyboard
7 is assigned to radius and 8 is assigned
to height OK
3 No operation required No result OK
3.1 Area = 3.142 * 7 * 7 Area = 153.86 OK
3.2 Volume = 153.86 * 8 Volume = 1230.88 OK
4 Print volume Algorithm finishes and terminate OK
5 Stop the algorithm Algorithm stops here OK
Table 2.2: A desk check to verify if the algorithm is solving the intended problem.
IMPLEMENTATION
/* ***********************************************
* Calculate the volume of a cylinder *
************************************************/
#include<stdio.h> /* Definition for printf and Scanf */
void main(){ /* The program starts here */
/* Perform variable declaration */
#define PI 3.142
float radius;
float height;
float area;
float volume;
/* Read read radius and height from keyboard */
printf("Enter the the radius and press enter >> ");
scanf("%f", &radius);
19. 19 | P a g e
printf("Enter the height and press enter >> ");
scanf("%f", &height);
/* Calculate volume */
area = PI * radius * radius;
volume = area * height;
/* Print volume */
printf("The volume of the cylinder is %f ", volume );
} /* the program finishes or terminates here */
Sample output of the program
Enter the the radius and press enter key >> 7
Enter the height and press enter key >> 8
The volume of the cylinder is 1231.66
TESTING
The same explanation given in case study I still holds in here so you can refer to testing in
case study I for a review.
Summary
A problem is a situation that is to be resolved using well-defined mathematical
principles
Solution is a means of finding solution to a problem
Problem solving is an act of finding a solution to perplexing, distressing, vexing or
unsettled question
Computer cannot be used to solve problems relating to physical activities or
emotional problems
Computer is very good at solving repetitive tasks in fast and consistent manner
The four Polya’s problem solving strategies are: Understanding the problem,
Device a plan, Carrying out the plan and Looking back
An algorithm is a sequential set of instructions that are followed in other to solve a
problem using a finite amount of data and time.
In problem solving one problem can have many algorithm while one algorithm can
be implemented using many programs
An algorithm consist of three components: input, process and output
An algorithm consist of five properties: Finiteness, Definiteness, Effectiveness,
Generality, and Input/output
20. 20 | P a g e
An algorithm can be expressed in three ways: Natural Language, Pseudo Code, and
Flow Chart.
The two methodologies used in the development of algorithm are top-down design
and object oriented design (OOD).
Top-down design is algorithm development approach that involves decomposition
of a large problem into manageable parts, that can be solved and unified to form
the solution of the overall problem
A module is a self-contained set of steps needed for the solution of problems
In top down-design approach, the problems are divided in a structured chart that
are composed of modules.
Abstract step is a step in the algorithm that contains some unspecified details
Concrete step is a step in the algorithm for which there is no need for further
specification of details.
Software Development Method is made up of the following implementation
strategies: requirement specification, analysis, design, implementation, testing and
maintenance.
Stepwise refinement is an algorithm development process that involves providing
in each step all the details needed to solve a problem.
Desk checking is the process of simulating the computer execution process by
going through the algorithm step-by-step in other to detect and correct errors.
Abstraction is the process of modeling a problem by extracting the relevant
information from the problem.
Exercises
Algorithm questions
1. Write an algorithm to calculate simple interest
2. Write an algorithm to calculate area of triangle
3. Write an algorithm to find the largest of three numbers x, y, z
4. Write an algorithm to test if a given integer value is prime or not
Programming questions
5. Write a C program to calculate simple interest
6. Write a C program to calculate area of triangle
7. Write a C program to find the largest of three numbers x, y, z
8. Write a C program to test if a given integer value is prime or not
Other questions
I will send more question before our next meeting.
21. 21 | P a g e
References
Government of Andhra Pradesh. (n.d.). Board of Intermediate Education. Retrieved from
bieap.gov.in/Pdf/CSPaperII.pdf
Institute of Distance & Open Learning (IDOL). (n.d.). University of Mubai. Retrieved from
archive.mu.ac.in/myweb_test/syllFybscit/C++.pdf
Koffman, J. R. (2016). ProblemSolving and Program Design in C. England: Pearson Education Limited.
McQuain. (2011, 12). CS 2104: Introduction to Problem Solving. Retrieved from Computer
Science@Virginia Tech: courses.cs.vt.edu/cs2104/Fall12/notes/T16_Algorithms.pdf
Nell Dale, John Lewis. (2002). C o m p u t e r Sc i e n c e Illuminated. Singapore: Jones and Bartlett.