Sequential Programming

Slides:



Advertisements
Similar presentations
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.
Advertisements

CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
CS 1400 Chapter 2 sections 1, 2, 4 – 6, 8,
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
CS107 Introduction to Computer Science Loops. Instructions Pseudocode Assign values to variables using basic arithmetic operations x = 3 y = x/10 z =
CS150 Introduction to Computer Science 1
School of Computing Science CMT1000 Ed Currie © Middlesex University Lecture 4: 1 CMT1000: Introduction to Programming Ed Currie Lecture 5a: Input and.
1 BIL106E Introduction to Scientific & Engineering Computing Organizational matters Fortran 90 ( subset F ): Basics Example programs in detail.
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.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
An Introduction to Textual Programming
Introduction to Computational Linguistics Programming I.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
Module 3 Fraser High School. Module 3 – Loops and Booleans import statements - random use the random.randint() function use while loop write conditional.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Problem Solving and Program Design in C (5th Edition) by Jeri R. Hanly and Elliot B. Koffman Chapter 1 (Software Development Method) © CPCS
1 E0001 Computers in Engineering Built in Functions.
Control Structures (A) Topics to cover here: Introduction to Control Structures in the algorithmic language Sequencing.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
CS 100 Introduction to Computing Seminar
Variables, Expressions and Statements
Counter-Controlled Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
COM S 207 Method Instructor: Ying Cai Department of Computer Science Iowa State University
CSC1030 HANDS-ON INTRODUCTION TO JAVA Introductory Lab.
CSCI-100 Introduction to Computing
Dialog Boxes.
Designing While Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Introduction to Computing Concepts Note Set 15. JOptionPane.showMessageDialog Message Dialog Allows you to give a brief message to the user Can be used.
ITEC 109 Lecture 7 Operations. Review Variables / Methods Functions Assignments –Purpose? –What provides the data? –What stores the data? –What type of.
Data Types and Conversions, Input from the Keyboard If you can't write it down in English, you can't code it. -- Peter Halpern If you lie to the computer,
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Special Methods in Java. Mathematical methods The Math library is extensive, has many methods that you can call to aid you in your programming. Math.pow(double.
CS1010: Programming Methodology
October 15, 2013 Welcome! We will begin shortly..
Lesson 4: Introduction to Control Statements 4.1 Additional Operators Extended Assignment Operators –The assignment operator can be combined with the.
Loops ( while and for ) CSE 1310 – Introduction to Computers and Programming Alexandra Stefan 1.
CS 240 Computer Programming 1
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
Input, Output and Variables GCSE Computer Science – Python.
2.3 Output Formatting. Outputting Format Specify the number of spaces, “c”, used to print an integer value with specifier %cd, e.g., %3d, %4d. E.g. printf.
Numbers and arithmetic
Introduction to Programming
Exercise : Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased.
Introduction to Programming
Using the Console.
while Repetition Structure
Chapter 1 Introduction to Java
Introduction to Algorithms
Data Types and Conversions, Input from the Keyboard
Standard Input - Output
C++ Programming: CS150 For.
Variables, Expressions, and IO
Computational Thinking
By: Muhammad Zidny Naf’an
Computational Thinking
CMIS 102 Competitive Success-- snaptutorial.com
CMIS 102 Education for Service-- snaptutorial.com
CMIS 102 Teaching Effectively-- snaptutorial.com
Use proper case (ie Caps for the beginnings of words)
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Module 4 Loops.
CHAPTER 6: Control Flow Tools (for and while loops)
Python Basics with Jupyter Notebook
The structure of programming
What you need to do… Drag the pieces of code into the correct order like you can see in the EXAMPLE below. print ( “ int input ) = + Hello world chr ord.
H446 Computer Science.
Presentation transcript:

Sequential Programming By: Muhammad Zidny Nafan

Introduction to Sequential Programming Executing program one by one instruction One isntruction exact one execute. No instruction will be repeated The order of instruction will be executed by the order in text (source code) The latest instruction is the latest algorithm

Example 1 Print Hello World in screen

Example 2 Count square’s area

Example 3 Problem: A salesman will receive commision from sale as big as 5% for each sale. Write the program to count salesman’s commision The algorithm is first program will asked user to input salesman’s name, and total sale. Then program will count commision. Then print name and commision in screen.

Example 3 Solving Problem: that program need 3 variables variable Data type name string sale long int commision double

Example 3 Code:

Example 4 Convert time to second Problem: A runner take on run time in hour, minute, and second. Write a program to convert run time become second. (example: run time= 1hour, 1minutes, 3second = 3663seconds) Solving: formula: (hours*3600) + (minutes *60)+seconds

Example 4 Code:

Exercise 1 Write program with these processes: Show “hello world” in screen Ask user to input his name And then print this message in screen: “Nice to meet you, <name>.”

The program must write the total price including taxes. Exercise 2 Write a program that asks the user to type the price without tax of one kilogram of tomatoes, the number of kilograms you want to buy, and the tax in percent units. The program must write the total price including taxes.

Exercise 3 Write a program that asks the user to type 5 integers and writes the average of the 5 integers. (but use only 2 variables).

Exercise 4 Write the program to help swalayan caseer for splitting return money by 50.000, 20.000, 10.000, 5.000, 2000, 1000, 500,and 100. Contoh: Return money : Rp. 88800 Splitting 1 pieces 50.000 1 pieces 20.000 1 pieces 10.000 1 pieces   5.000 1 pieces    2000 1 pieces    1000 1 pieces      500 3 pieces      100