Programming.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Introduction to C++ September 12, Today’s Agenda Quick Review Check your programs from yesterday Another Simple Program: Adding Two Numbers Rules.
Chapter 1 Welcome everyone to Visual Logic. We will use this book and the next couple of weeks to learn to solve problems, develop a visual representation.
ITEC113 Algorithms and Programming Techniques
Computer Science 1620 Variables and Memory. Review Examples: write a program that calculates and displays the average of the numbers 45, 69, and 106.
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
CMT Programming Software Applications
Chapter 2: Input, Processing, and Output
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
1 Lab Assignment#5 Due 12/7 A car can hold 12 gallons of gasoline and it can travel 360 miles without refuelling. Write a program the displays the trip.
CS 1400 Chapter 1 Introduction and Background
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
JavaScript, Third Edition
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Basic Elements of C++ Chapter 2.
110-D1 Variables, Constants and Calculations(1) Chapter 3: we are familiar with VB IDE (building a form…) to make our applications more powerful, we need.
Identifiers and Assignment Statements. Data structures In any programming language you need to refer to data The simplest way is with the actual data.
CH1 – A 1 st Program Using C#. Program Set of instructions which tell a computer what to do. Machine Language Basic language computers use to control.
Variables, Constants, Methods, and Calculations Chapter 3 - Review.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
DCT 1123 Problem Solving & Algorithms
CIS Computer Programming Logic
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
Input, Output, and Processing
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
CHAPTER 4: CONTROL STRUCTURES - SEQUENCING 10/14/2014 PROBLEM SOLVING & ALGORITHM (DCT 1123)
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
An Object-Oriented Approach to Programming Logic and Design Chapter 1 An Overview of Computers and Logic.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Introduction to Programming with RAPTOR
Control Structures (A) Topics to cover here: Introduction to Control Structures in the algorithmic language Sequencing.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
THE BASICS OF A C++ PROGRAM EDP 4 / MATH 23 TTH 5:45 – 7:15.
Chapter 2: Introduction to C++. Language Elements Keywords Programmer-defined symbols (identifiers) Operators Punctuation Syntax Lines and Statements.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
Variables and Assignment CSIS 1595: Fundamentals of Programming and Problem Solving 1.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
1 Week 5 l Primitive Data types l Assignment l Expressions l Documentation & Style Primitive Types, Assignments, and Expressions.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Quiz 1 A sample quiz 1 is linked to the grading page on the course web site. Everything up to and including this Friday’s lecture except that conditionals.
Chapter Topics The Basics of a C++ Program Data Types
Introduction to Algorithms
BASIC ELEMENTS OF A COMPUTER PROGRAM
1-1 Logic and Syntax A computer program is a solution to a problem.
Programming Fundamental
Basic Elements of C++.
Data Types, Identifiers, and Expressions
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 2 Applications and Data.
Basic Elements of C++ Chapter 2.
Data Types, Identifiers, and Expressions
Introduction to C++ Programming
Programming Right from the Start with Visual Basic .NET 1/e
Programming Funamental slides
Chapter 2: Input, Processing, and Output
Primitive Types and Expressions
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Programming

Algorithm A computer program is a solution to a problem. An algorithm is the logical design used to accomplish a specific objective. Algorithms are well-ordered. Algorithms have unambiguous operations. Algorithms have effectively computable operations. Algorithms produce a result. Algorithms halt in a finite amount of time.

Syntax / Information System Syntax refers to the specific rules of a programming language. An information system is a combination of people and technology that collect, organize, and process data to produce information.

Information System Cont. An information system must do at least three things: input data into the system process data within the system output resulting information from the system

Variable For now they will be either for strings or numbers Memory location that can be accessed and changed by developer code Can store only one piece of data at any time Variables have a data type For now they will be either for strings or numbers

Rules for Naming Variables Name must begin with a letter. Name can contain only letters, numbers, and the underscore. No punctuation characters or spaces are allowed. Name cannot exceed 255 characters. Name cannot be a reserved word. public, int, private

Rules for Naming Variables cont. Should be meaningful and descriptive representing the variable’s purpose Short names are bad Capitalize words for readability (Pascal case) InterestRate Many programmers use a prefix to show the variables data type decInterestRate

Input Statements An input statement accepts data from the user and stores that data into a variable In Visual Logic a Prompt can be added to request input by clicking on More>>

Simple Programming Formats

Assignment Statements (data into memory) The assignment statement can be used to perform a calculation and store the result. An expression is a value-returning code element, such as a variable or mathematical formula. The expression on the right hand side is evaluated and stored in the variable on the left hand side.

How to Write Arithmetic Expressions Don’t forget the rules of precedence when writing expressions.

Output Statements Types of output include Screen output Printed output Sound output Saving to storage devices Your output should be appealing to the user. Use & and multi-line when appropriate. Your output should provide the answer to the problem.

Pseudocode/Flow Charts Human readable Not written towards one language Well defined Little to no syntax Use of keywords START WHILE FOR IF NOT TRUE

Develop a solution to a problem Jake has a car with an 8-gallon fuel tank. Jake fills his tank with gas and then drives 60 miles to a friend's house. When he gets to his friend's house, he has 6 gallons left in his fuel tank. Write a program that uses three input elements to enter values for tank size, miles traveled and gallons left. The program should calculate and display how many miles Jake can drive on a full tank of gas.

Jakes Problem Identify the Inputs, processing and outputs. Inputs (variables) Processing (assignment statements) Output (provide answer)

Intrinsic Functions Intrinsic functions are predefined commands that provide developers with common, helpful functionality. A function takes one or more arguments/parameters. A function returns a result which can be assigned to a variable, output, or used in an expression.

Intrinsic Functions (cont.) Length(strVariable) The number of characters in the string.