King Saud University College of applied studies and community services CSC 206 Programming with Basic Lecture 1.

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING TECHNIQUES
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
1.4 Programming Tools Flowcharts Pseudocode Hierarchy Chart
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2 - Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ALGORITHMS AND FLOWCHARTS
Chapter 2 - Problem Solving
Chapter 1 Pseudocode & Flowcharts
Fundamentals of Algorithms MCS - 2 Lecture # 4
 Introduction to Programming History of programming.
Chapter 2- Visual Basic Schneider
The Program Development Cycle and Program Design Tools
Developing logic (Examples on algorithm and flowchart)
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Review Algorithm Analysis Problem Solving Space Complexity
PRE-PROGRAMMING PHASE
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
Your Interactive Guide to the Digital World Discovering Computers 2012.
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
King Saud University College of applied studies and community services CSC 1101 Computer Programming I Lecture 2.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Basic problem solving CSC 111.
Chapter 1 Pseudocode & Flowcharts
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
CS2301:Computer Programming 2
Introduction to Computing Dr. Nadeem A Khan. Lecture 2.
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Lecture 2: Introduction to Programming EEE2108: 공학프로그래밍 서강대학교 전자공학과 2011 학년도 2 학기 - Algorithms and Flowcharts -
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
 Problem Analysis  Coding  Debugging  Testing.
Chapter One Problem Solving
Program design Program Design Process has 2 phases:
GC101 Introduction to computers and programs
Programming Languages
Chapter One Problem Solving
CSCI-235 Micro-Computer Applications
Chapter 2- Visual Basic Schneider
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Algorithms and Flowcharts
Lecture 2 Introduction to Programming
Lecture2.
An Introduction to Visual Basic .NET and Program Design
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
VISUAL BASIC – CHAPTER ONE NOTES An Introduction to Visual Basic
(Course Introduction)
Pseudocode & Flowcharts
Chapter 2- Visual Basic Schneider
Chapter 1 Pseudocode & Flowcharts
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
Introduction to Programming
Chapter 1 Pseudocode & Flowcharts
Presentation transcript:

King Saud University College of applied studies and community services CSC 206 Programming with Basic Lecture 1

BASIC Stands for Beginners’ All-Purpose Symbolic Instruction Code Developed to teach programming to college students Became very popular with the introduction of the microcomputer

Outline and Objective What Is A Computer Program? Software? Problem Solving Program Development Cycle Flow chart

What Is A Computer Program? Software? Program = set of instructions that a computer will follow to perform a specific task. Software = collection of programs. Two types of software: System software: used to manage computer hardware to enable us to execute & write application programs/software. Ex. Operating System, Compilers, …etc. Application Software: are meant for solving users own problems. Ex. Word processors, database management…etc.

5 Program Development Cycle: 1. Analyze: Define the problem 2. Design: Plan the solution to the problem 3. Develop the Interface: Select the objects

Program Development Cycle: 4.Code: Translate the algorithm into a programming language. 5. Debug and Test: Locate and remove any errors in the program. 6. Complete the Documentation: Organize all the materials that describe the program

The Software Development Method 1. Specify the problem requirements. 2. Analyze the problem. 3. Design the algorithm to solve the problem. 4. Implement the algorithm. 5. Test and verify the completed program. 6. Maintain and update the program. 7

خطوات حل المسائل وخطوات كتابة البرامج : صياغة حل المسألة : اولا : اولا : تعريف وتحليل عناصر المسألة وذلك يتم بالتالي : تحديد مخرجات البرنامج تحديد مدخلات البرنامج تحديد عمليات البرمجه ثانيا ثانيا : كتابة الخوارزم وذلك بكتابة الخطوات الخوارزمية للمسألة. ثالثا ثالثا : رسم مخططات الانسياب

مثال : اكتب برنامجا بحيث يقرأ رقمين صحيحة ثم يطبع مجموعهم الحل : اولا : اولا : تعريف وتحليل عناصر المسألة وذلك يتم بالتالي : تحديد مخرجات البرنامج : مجموع العددين z تحديد مدخلات البرنامج : الرقمين الصحيحة x, y تحديد عمليات البرمجه : عملية الجمع z=x+y ثانيا ثانيا : كتابة الخوارزم 1. ندخل رقمين x y 2. نحسب مجموع العددين z=x+y 3. نطبع ناتج الجمع 4. النهاية

h البداية start Input x,y ادخل x, y اطبع z Output z احسب z=x+y process النهاية end

كتابة البرنامج وتنفيذه : كتابة البرنامج بواسطة احدى لغات البرمجه ترجمة البرنامج الى لغة الاله. اختبار البرنامج واصلاح الاخطاء.

What is a flowchart? Diagram that visually represents the steps that the program performs to arrive at a solution. A popular logic tool used for showing an algorithm in graphical form. Programmer draws flowchart before coding.

13 Most common flowchart symbols are: – Flowline – Terminal – Input/Output – Processing – Decision

Purpose of Flowcharting: An aid in developing the logic of a program. Verification that all possible conditions have been considered in a program. Provides means of communication with others about the program. A guide in coding the program. Documentation for the program.

2.5The if Selection Structure true false grade >= 60 print “Passed ”

17 Example of Flowchart: Start Initialize counter and sum to 0 Are there more data? Get next grade Increment counter Add grade to sum Yes No Average=sum/counter Finish

Exercise Write a program to process a collection of daily temperatures. Your program should count and print the number of hot days (85 or higher), the number of pleasant days ( ), the number of cold days (less than 60). It should also display the category of each temperature. 18

Exercise 1. Specify the problem requirements 2. Analyze the problem Input: Output: temperature A program is required to process daily temperatures and provide the total number of hot, pleasant, and cold days. total number of days in each category 3. Design the algorithm to solve the problem 1. Get the temperature. 2. Determine category of that temperature and increment counter for that particular category. 3. Display categories and total number of days that fell under the category. 19

>=85? Print Hot, Cold, and Pleasant End Add 1 to Hot Yes Add 1 to Cold Yes <=60? No Add 1 to Pleasant No Get Temp Exercise Start 20

Exercise write a program that reads the number of a hours an employee works and calculate an overtime pay for employees who work more than 40 hours and then display the paycheck. write a program that reads the name and grade of a student, and displays a note that shows wither the student passed or failed. write a program that reads the whether temperature In F° and then display it in C°. write a program that reads three numbers, then displays the sum, the average, and the largest of these numbers. 21