ME1107 Computing 1 2007-2008 Y Yan

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 1 Engineering Problem Solving.
Advertisements

Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Introduction to Programming in C++ John Galletly.
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Programming The Development Environment and Your First C Program.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
1 Chapter Two Introduction to the Programming Language C.
C programming Language and Data Structure For DIT Students.
INTRODUCTION TO PYTHON PART 2 INPUT AND OUTPUT CSC482 Introduction to Text Analytics Thomas Tiahrt, MA, PhD.
Programming is instructing a computer to perform a task for you with the help of a programming language.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Introduction to FORTRAN-90 University of Liverpool course.
Intro. to Game Programming Want to program a game?
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Hello World 2 What does all that mean?.
CSC141 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Programming 1 1. Introduction to object oriented programming and problem-solving.
CISC105 General Computer Science Class 1 – 6/5/2006.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
1 Agenda Administration Background Our first C program Working environment Exercise Memory and Variables.
Programming Lifecycle
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Logic and Systems A beginner’s guide.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Arithmetic expressions containing Mathematical functions.
Lecture 2 Programming life cycle. computer piano analogy Piano + player - computer hardware Musical score/notes - software or program Composer - programmer.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Java FilesOops - Mistake Java lingoSyntax
The Hashemite University Computer Engineering Department
Working with floating point expressions. Arithmetic expressions Using the arithmetic operators: and brackets (... ), we can construct arithmetic expression.
1 Overview of Programming Principles of Computers.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Chapter 1: Introduction to Computers and Programming.
Introduction Dr. Entesar Ganash. 1.Fundamentals of computer programming Central Processor Unit Main Memory Backing Store OutputInput 1.1 What is a computer?
Software Engineering Algorithms, Compilers, & Lifecycle.
Chapter 1 Introduction 2nd Semester H
Topic 2: Hardware and Software
Engineering Problem Solving With C An Object Based Approach
CSCI-235 Micro-Computer Applications
1-1 Logic and Syntax A computer program is a solution to a problem.
Computer Science I CSC 135.
PROGRAM STRUCTURE CSC 111.
Programming Right from the Start with Visual Basic .NET 1/e
Programming Funamental slides
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
A programming language
Understand the interaction between computer hardware and software
Presentation transcript:

ME1107 Computing Y Yan

2 About Fortran Fortran – Formula Translation High level computer language –Basic, Fortran, C, C++, Java, C#,………Matlab What do we learn? –basic programming skills –self-learning skills References –Text book (Fortran 77 for Engineers) –Online notes (course website)

3 Creating Executable Code Building a solution: combines compiling and linking into one action The.f95 extension is vital! Source code ( text ) object code ( binary ) Executable code File1.f95 File2.f95 File1.obj File2.obj libraries Prog1.exe compilinglinking

4 Fortran Programming Environment Salford Plato, Integrated Development Environment (IDE), is used for Fortran programming Create a folder for Fortran programs Copy three files including salflibc.dll to the Fortran folder (those files should be always kept in the folder for Fortran programs) Start Salford Start -> programs -> F. Departmental software -> B. Engineering & mathematics -> Fortran 95 -> Salford Plato IDE Getting Started

5 Exercise 1: Your first Fortran program ! ! Your name, Group ! Date ! ! Hello World Program Prog1 Print *,’Hello World’ Print *,’ your name’ End Prog1

6 Exercise 2: Run the quadratic equation solver

7 Variable types Declaration of variables are not compulsory Without declarations –I, J, K, L, M, N are integer type –the rest are real type IMPLICITY NONE – all variables must be declared

8 Output statement The syntax of output statement: WRITE (output_device, format[, options]) list PRINT format, list (standard output device, usually the screen) Print *,’Hello World’ Print *,’ your name’ Print *,’Input A, B, C’ Print *, ‘Roots are ’, ROOT1, ROOT2 Write(*,*) ‘Roots are ’, ROOT1, ROOT2

9 Input statement The syntax of input statement: READ (input_device, format[, options]) list_of_variables READ format, list_of_variables (standard input device, usually the keyboard) Print *,’Input A, B, C’ Read *, A, B, C Read(*,*) A, B, C

10 Exercise 3. Write a program for this flowchart start Input deg Calculate rad Output rad end deg and rad are two variables, which are the names given to two memory locations for storing data.