Solving Problems with Computers

Slides:



Advertisements
Similar presentations
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 21: Graphs.
Advertisements

FIRST COURSE Outlook Tutorial 1 Communicating with Outlook 2007.
Chapter 6: User-Defined Functions I
Excel Tutorial 2 Formatting a Workbook
FIRST COURSE Excel Tutorial 3 Working with Formulas and Functions.
Excel Tutorial 1 Getting Started with Excel
Guide to Networking Essentials Fifth Edition
CCNA Guide to Cisco Networking Fundamentals Fourth Edition
C++ Programming:. From Problem Analysis
Chapter 10: Applications of Arrays and Strings J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second.
Microsoft Office 2007 Web Feature Sharing Access Data.
Andrew C. Samuels, Information Technology Specialist Trainer c/o Ministry of Education Mona High School, Kingston, Jamaica 1 Problem Solving Section 2:
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 10 Creating Classes and Objects.
CS 240 Computer Programming 1
An Introduction to Programming with C++ Fifth Edition
An Introduction to Programming with C++ Fifth Edition Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Understanding Operating Systems Fifth Edition Chapter 12 System Management.
Chapter 12: Inheritance and Composition
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 20: Binary Trees.
Microsoft Office 2007 Access Integration Feature Sharing Data Among Applications.
Concepts in Enterprise Resource Planning Fourth Edition Chapter One Business Functions and Business Processes.
Network+ Guide to Networks 6 th Edition Chapter 9 In-Depth TCP/IP Networking.
ALGORITHMS AND FLOWCHARTS
Programming Funamental slides1 Control Structures Topics to cover here: Introduction to Control Structures in the algorithmic language Sequencing Sequencing.
Representing an algorithm using Flowcharts
PROBLEM SOLVING TECHNIQUES
PSEUDOCODE & FLOW CHART
UNIT 2. Introduction to Computer Programming
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
CS 240 Computer Programming 1
Chapter 1 Pseudocode & Flowcharts
Fundamentals of Algorithms MCS - 2 Lecture # 4
Chapter 2- Visual Basic Schneider
CHAPTER 4: ALGORITHM 4.1 Introduction stages identified in the program development process: 1. Problem analysis and specification 2. Data organization.
Review Algorithm Analysis Problem Solving Space Complexity
Algorithm & Flowchart.
Chapter 1 Pseudocode & Flowcharts
Introduction to Algorithm – part one Jennifer Elmer Form 3 Computing.
CSC141 Introduction to Computer Programming
Chapter 2: General Problem Solving Concepts
Pseudocode Algorithms Using Sequence, Selection, and Repetition Simple Program Design Third Edition A Step-by-Step Approach 6.
CHAPTER 1 INTRODUCTION 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Basic problem solving CSC 111.
Chapter 1 Pseudocode & Flowcharts
1 Program Planning and Design Important stages before actual program is written.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
Chapter One Problem Solving
Program design Program Design Process has 2 phases:
GC101 Introduction to computers and programs
Chapter One Problem Solving
Chapter 2- Visual Basic Schneider
CS111 Computer Programming
Computer Programming Flowchart.
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Introduction to Algorithm – part 1
Programming Logic n Techniques
Chapter 1 Pseudocode & Flowcharts
PROBLEM SOLVING CSC 111.
Pseudocode & Flowcharts
الفصل الثاني الخوارزمية
Chapter 2- Visual Basic Schneider
Chapter 1 Pseudocode & Flowcharts
Introduction to Algorithms and Programming
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Faculty of Computer Science & Information System
Introduction to Programming
WJEC GCSE Computer Science
Chapter 1 Pseudocode & Flowcharts
Presentation transcript:

CSC 111 http://csc111.wordpress.com

Solving Problems with Computers

Solving Problems Stages Problem Definition Define the main Problem Java Programming: From Problem Analysis to Program Design, Third Edition

Problem Definition Write a Program to Print the Sum of two integer Numbers Write a program to Print the Average of three integer numbers Write a program to print the volume of a cube and the sum of it’s surfaces’ areas Java Programming: From Problem Analysis to Program Design, Third Edition

Solving Problems Stages Problem Definition Define the main Problem Problem Analysis Determine the inputs, outputs, Arithmetic & logic operations Java Programming: From Problem Analysis to Program Design, Third Edition

Problem Analysis Write a Program to Print the Sum of two integer Numbers Inputs : First Number Second Number Operations : Summation = first + second Output : The summation Java Programming: From Problem Analysis to Program Design, Third Edition

Problem Analysis Write a program to Print the Average of three integer numbers Inputs : First Number Second Number Third Number Operations : Average = (first + second + third ) / 3 Output : The Average Java Programming: From Problem Analysis to Program Design, Third Edition

Problem Analysis Write a program to print the volume of a cube and the sum of it’s surfaces’ areas Inputs : Side Length Operations : Volume = side * side * side Surface area = ( side * side ) * 6 Output : The Volume The surface area Java Programming: From Problem Analysis to Program Design, Third Edition

Solving Problems Stages Problem Definition Algorithm Problem Analysis Solution Design Design a solution for the problem by writing an algorithm or drawing a flow chart Flow Chart Java Programming: From Problem Analysis to Program Design, Third Edition

Basic steps for designing a solution Read all the inputs Calculate operations Print the output Java Programming: From Problem Analysis to Program Design, Third Edition

Algorithms Write a Program to Print the Sum of two integer Numbers Start the program Read the first number ( N1 ) Read the second number ( N2 ) Sum the both numbers in ( Sum )  Sum = N1 + N2 Print the variable ( Sum ) End the program Java Programming: From Problem Analysis to Program Design, Third Edition

Algorithms Write a program to Print the Average of three integer numbers Start the program Read the first number ( num1 ) Read the second number ( num2 ) Read the third number ( num3 ) Sum the three numbers in ( result )  result = num1 + num2 + num3 Java Programming: From Problem Analysis to Program Design, Third Edition

Algorithms Write a program to Print the Average of three integer numbers Divide the ( result ) by 3 and save the result in ( Average )  Average = result / 3 Print the ( Average ) End the program Java Programming: From Problem Analysis to Program Design, Third Edition

Algorithms Write a program to print the volume of a cube and the sum of it’s surfaces’ areas Start the program Read the length of the side ( Length ) Volume = Length * Length * Length Surface = ( Length * Length ) * 6 Print the ( Volume ) Print the ( Surface ) End the program Java Programming: From Problem Analysis to Program Design, Third Edition

Organization of Instructions Instructions that describe behavior can be organized in three ways in most programming languages: Sequentially Conditionally (Selection) Repetitively Java Programming: From Problem Analysis to Program Design, Third Edition

Conditionally (Selection) Sequentially Conditionally (Selection) Repetitively Java Programming: From Problem Analysis to Program Design, Third Edition

Flow Charts Java Programming: From Problem Analysis to Program Design, Third Edition

Flow chart’s Symbols Start/End End Start Read/Print Print n1 Read n1 Arithmetic Operations N2 = n1+3 N2 = 5 Decision n1 > 3 Loops Connectors arrows Connectors points Comments // my name Java Programming: From Problem Analysis to Program Design, Third Edition

Simple Sequential Flow Charts start End

Write a Program to Print the Sum of two integer Numbers start Start the program Read the first number ( N1 ) Read the second number ( N2 ) Sum the both numbers in ( Sum )  Sum = N1 + N2 Print the ( Sum ) End the program Read N1 Read N2 Sum = N1 + N2 Print Sum End Java Programming: From Problem Analysis to Program Design, Third Edition

Read the length of the side ( Length ) Write a program to print the volume of a cube and the sum of it’s surfaces’ areas start Start the program Read the length of the side ( Length ) Volume = Length * Length * Length Surface = ( Length * Length ) * 6 Print the ( Volume ) Print the ( Surface ) End the program Read L Volume = L * L * L ٍSurface = ( L * L ) * 6 Print Volume Print Surface End Java Programming: From Problem Analysis to Program Design, Third Edition

Write a program to Print the Average of three integer numbers start or Read num1 start Read num2 Read num1,num2,num3 Read num3 result = num1+num2+num3 result = num1+num2+num3 Average = result/3 Average = result/3 Print Average Print Average End End Java Programming: From Problem Analysis to Program Design, Third Edition

Write a program to Print the Average of three integer numbers or start Read num1,num2,num3 Average = ( num1+num2+num3 ) / 3 Print Average End Java Programming: From Problem Analysis to Program Design, Third Edition

Write a program to Print the Average of three integer numbers start start result = num1+num2+num3 Read num3 Read num1 Read num1 Read num2 Read num2 result = num1+num2+num3 Read num3 Average = result/3 Average = result/3 Print Average Print Average End End Java Programming: From Problem Analysis to Program Design, Third Edition

Write a program to Print the Average of three integer numbers start start Read num1, num2,num3 Read num1, num2,num3 result = num1+num2+num3 Average = result/3 Average = result/3 result = num1+num2+num3 Print result Print Average Print result End End Java Programming: From Problem Analysis to Program Design, Third Edition