Algorithms and Programming

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

Tutorial 12: Enhancing Excel with Visual Basic for Applications
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Program Design and Development
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Chapter 1 Program Design
Chapter 3 Planning Your Solution
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Chapter 3 Planning Your Solution
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Introduction to VBA. What is VBA? VBA stands for Visual Basic for Applications. It is a programming language used exclusively by the Microsoft Office.
Simple Program Design Third Edition A Step-by-Step Approach
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
VBA (Visual Basic for Applications) What is Excel, just a spreadsheet? Time for Demos...
Microsoft Excel Macros & Excel Solver (IENG490)
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
Python Programming, 2/e1 Python Programming: An Introduction to Computer Science Chapter 2.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
PROGRAMMING. Objectives Define the term program List and explain the steps involved in developing a program.
Chapter 11 An Introduction to Visual Basic 2008 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Chapter 11 An Introduction to Visual Basic 2005 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
Chapter 9 Macros And Visual Basic For Applications.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Introduction to Programming in VB Chapter 1. 2 Software Development Life Cycle Gather Requirements Design Program Code & Test Program Implement u Software.
 Programming - the process of creating computer programs.
Introduction to Microsoft Excel Macros COE 201- Computer Proficiency.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
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.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
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.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Introduction to Programming Lecture 1 – Overview
Introduction To Visual Basic 6
Topic: Introduction to Computing Science and Programming + Algorithm
INTRODUCTION TO PROBLEM SOLVING
Topic: Introduction to Computing Science and Programming + Algorithm
Data Searching and Sorting algorithms
The Design and Analysis of Algorithms
CSCI-235 Micro-Computer Applications
Key Ideas from day 1 slides
Chapter 2: Input, Processing, and Output
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
VBA (Visual Basic for Applications) What is Excel, just a spreadsheet?
Innovative Technology Solutions
Lecture 2 Introduction to Programming
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Introduction CSE 1310 – Introduction to Computers and Programming
Algorithm and Ambiguity
Microsoft Excel 2003 Illustrated Complete
An Introduction to Visual Basic .NET and Program Design
Computer Programming.
Unit# 9: Computer Program Development
VISUAL BASIC – CHAPTER ONE NOTES An Introduction to Visual Basic
Exploring Microsoft Excel
Introduction to Algorithms and Programming
Chapter One: An Introduction to Programming and Visual Basic
The Programming Process
Programming We have seen various examples of programming languages
The PlayStation Example
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Chapter 2: Input, Processing, and Output
WJEC GCSE Computer Science
CMPT 120 Lecture 2 - Introduction to Computing Science – Problem Solving, Algorithm and Programming.
Starter Which of these inventions is: Used most by people in Britain
Visual Basic for Applications: Introduction
Presentation transcript:

Algorithms and Programming Ahti Lohk Teaching Assistant in Department of Software Science PhD (in Computer Science)

Agenda This presentation answers to the following questions: What is algorithm and how to represent it? What is programming? What is programming language? What is VBA and for what to use it? How to write the first program (more precisely, we will write an user defined function)? The structure of user defined structure.

What is algorithm? „An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time“1. 1Introduction to The Design and Analysis of Algorithms (2012), Anany Levitin

Ways to represent algorithms Some well-known are as follows: Pseudocode Natural language Diagrams (flowcharts) – e.g., activity diagram in UML Programming code The picture originates from here Weekly task 1 (2 points) – please find out some simple examples to these categories (ex. programming code) from internet. Study how to use them/(how do they work) and choose one algorithm and represent it in these 3 categories. Results in MS Word document/LibreOffice Writer. Add references.

What is programming? In a narrower meaning: Programming is coding or writing the code in certain programming language. Or, programming is writing instructions to the computer. In a broader meaning: Programming is a diverse process that contains: the analysis of the problem, algorithm and code design, code writing, evaluating and testing.

What is a programming language? The programming language is: artificial language created by man to describe actions which must be done with computer „The programming language is just a tool to express thought (more precisely, an algorithm that represents a solution to any problem) to the computer“. In many cases „it really doesn’t matter much, what programming language you use; your choice generally depends on personal experience/knowledge about the specific programming language.“1 1 http://blog.sudobits.com/2011/04/14/the-most-popular-programming-languages/

The most popular programming languages in the world (2016) IEEE Spectrum TIOBE Index for January 2017 http://spectrum.ieee.org/computing/software/the-2016-top-programming-languages http://www.tiobe.com/tiobe-index/

The oldest languages in use Fortran (1957) LIST (1958) COBOL (1959) ... http://en.wikipedia.org/wiki/Timeline_of_programming_languages Teacher proposed task 1 (1 point): please find out what kind of programming languages are used in case of the following applications: Amazon, eBay, Facebook, Google, Pinrest, Twitter, Wikipedia, YouTube. At least two languages for every case. Add references.

What is VBA? „VBA, which stands for Visual Basic for Applications, is a programming language developed by Microsoft“ VBA is used in Excel (or in other MS Office Application, but also in AutoCAD, ArcGIS, SolidWorks, CorelDraw and WordPerfect) VBA makes possible to operate: different type of data (numbers, text, date values and true-values) and Excel objects (workbooks, worksheets, cells, shapes, diagrams, menu bars, etc.)

Visual Basic Editor (VBE) (press Alt+F11) (Environment where to use VBA is called VBE) Into this window we will write the code  „Figure 2.10 The VBE with significant elements identified.“ Figure originates from book „Excel 2016 Power Programming with VBA“ (Chapter 2) by Michael Alexander and Richard Kusleika (available in Safari)

For what to use VBA? Just FYI, it is possible to use VBA for all actions that are possible without VBA. It means, to create new workbooks, add or delete worksheets, charts, shapes, enter values or formulas into cells, etc. Additionally, VBA helps to execute actions impossible implement in Excel only. VBA makes possible to: automate actions (i.e., create lot of documents, charts, data tables, shapes; read information from files, internet, databases) develop new (user defined) functions, … See more „Excel VBA Programming For Dummies“, chapter 1. Weekly task 2 (1 point): please find out (does not appear in our two books), in what concrete way VBA is used in Excel (5 cases). Choose only examples you are available to understand. Describe them at least with two-three sentences. Add references.

First program (function) Step 1: Open VBE (Visual Basic Editor) with Alt+F11 Step 2: Add new Module from menu: Insert/Module (Module1 appears into Project window) Step 3: Write program code (function) into code window (to the Module 1 Step 4: Use/apply written function in Excel (result will be 9).

The structure of user defined function Function function_name(parameter1, parameter2, …) ‘Sentence(s) function_name = result End Function Compare it to real case Parameter is a special kind of variable, that is used for passing information (at the moment) from worksheet to user defined function Here, parameters are like input data. Function name and parameter name are defined by user. Variable is a named location in computer memory that maintains values.