We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byEllie Merriman
Modified over 2 years ago
Files Using Sequential files (Flowchart example) © Juhani Välimäki 2003
Sequential files (in our flowcharts) Serial access: Can be read only from the beginning towards the end. Not possible to move backwards. File opened either for reading (R) or for writing (W). Reading only one record (=data compound) at a time or writing one data compound into the file. If the file was opened for writing it’s contains are emptied and whatever was inside will be lost. © Juhani Välimäki 2003
Example – Problem description We have a file called “grades”. It contains names of locations(like “London”) and the annual average temperature in centigrades Now we would like to convert the temperatures to the Fahrenheit-scale for some other marketing area. Names are good as they are (“London”). © Juhani Välimäki 2003
Example – Temperature conversion We read from the file “grades”. That file will be opened for reading (R). We read record by record to the data compound variable grade T_GRADE. We convert the centigrades Fahrenheit-degrees using formula F = centigrades * We create a new variable temp T_TEMPERATURE, which will written to the output file. The result will be written to the file “temperatures”. That file was opened for writing (W). © Juhani Välimäki 2003
Example – Converter program DEFINITIONS grades sequential file TYPE T_GRADE location AN 20 celsius N 3 grade T_GRADE temperatures sequential file TYPE T_TEMPERATURE city AN 20 fahrenheit N 3 temp T_TEMPERATURE STAR T END READ grades -> grade temp.fahrenheit = grade.celsius * OPEN grades(R), temperatures(W) NOT grades-EOF FALSE TRUE WRITE temp -> temperatures CLOSE grades, temperatures temp.city = grade.location © Juhani Välimäki 2003
Example – What happens in the program? grades ”London” ”Helsinki” ”Agadir” ”New York” ”Bruexelles” ”Caraca s””Mani toba” temperatures ”London”50 ”London” 10 ”London” 50 grade T_GRADEtemp T_TEMPERATURE (assignment) temperatures sequential file TYYPPI T_TEMPERATURE city AN 20 fahrenheit N 3 city AN 20 fahrenheit N 3 grades sequential file TYYPPI T_GRADE location AN 20 celsius N 3 location AN 20 celsius N 3 READ WRITE © Juhani Välimäki 2003 (assigning the result of the conversion 10 x = 50)
Example – What happens next? grades ”London” ”Helsinki” ”Agadir” ”New York” ”Bruexelles” ”Caraca s””Mani toba” temperatures ”London” ”Helsinki” ”Helsinki” 5 41 READ WRITE grade T_GRADEtemp T_TEMPERATURE (assignment) (assigning the result of the conversion 5 x = 41) temperatures sequential file TYPE T_TEMPERATURE city AN 20 fahrenheit N 3 city AN 20 fahrenheit N 3 grades sequential file TYPE T_GRADE location AN 20 celsius N 3 location AN 20 celsius N 3 © Juhani Välimäki 2003
Real life: Files Files are simplified to make easier programs Might be possible to read and write to the same file. Might be possible to move backwards inside the file. © Juhani Välimäki 2003
TEMPERATURE CONVERSION FAHRENHEIT AND CELSIUS SCALES.
Unit 25 Celsius and Fahrenheit. Basic Principles of Celsius and Fahrenheit Conversions The temperature measurement used most commonly in the United States.
Linear Inequalities Solving Linear Inequalities. 7/2/2013 Linear Inequalities 2 2 Meanings and Solutions What does f(x) < g(x) mean? f(x) < g(x) is an.
START DEFINITIONS values (3) N1 = (8, 1,-9) i N1 average N3,2 sum N2 = 0 temp N1 Do not guess or assume any values! Follow the values of the variables.
Basics of Most C++ Programs // Programmer: Clayton Price date: 9/4/ // File: fahr2celc.cpp 03. // Purpose:
Temperature SOL 2.19 Grade 2 Created by; Kim Smith.
Two different ladders both go from the ground to the top of the same building. Ladder #1 has 100 rungs and ladder #2 has 120 rungs. Two people climb up.
1. Know the different types of flow block 2. Understand how problems can be broken down into smaller problems.
FINDING THE EQUATION OF A LINE 1.KNOWING A POINT AND THE SLOPE 2.KNOWING TWO POINTS.
Solving Inequalities Solving inequalities follows the same procedures as solving equations. There are a few special things to consider with inequalities:
Temp Conversions Centigrade, Fahrenheit, Absolute.
Temperature Conversions. Conversion Formulas F = (9 · C) C = K -273 C = 5 · ( F – 32 ) 9 K = C F = Fahrenheit C = Celsius K = Kelvin.
Topic: Heat and Temperature PSSA: C / S8.C.2.1.
Temperature. Degrees The unit used to measure temperature. Symbol = °
TEMPERATURE Fahrenheit ( o F) Celsius ( o C) Kelvin (K)
Lecture 10 Flow of Control: Loops (Part 2) COMP1681 / SE15 Introduction to Programming.
DAY 2 – LINEAR REPRESENTATIONS Unit 1 – Linear Programming.
EXAMPLE 4 Solve a multi-step problem You are visiting Toronto, Canada, over the weekend. A website gives the forecast shown. Find the low temperatures.
Chapter 1 Algebra, Mathematical Models, and Problem Solving.
Temperature conversions. C to F 1.Open excel 2. In cell "A1" type in "Celsius“ 3. In cell "B1" type in Fahrenheit 4. Since we are converting to celsius.
How Low Can You Go??. Temperature Scales Nova Temperature: Quantifying Cold 10:17
The temperature of the human body would be 37°C °C.
Temperature Temperature is a qualitative measurement- movement of molecules How hot or cold something is. Fahrenheit Celsius o F = 9/5C + 32 o C = 5/9.
1 Temperature Scales & Temperature Conversions There are 3 ways to measure temperature: Fahrenheit Centigrade (or Celsius) Kelvin of 20.
Physics Review for the GHSGT. Types of energy Solar Electrical Nuclear Chemical Mechanical Potential Kinetic.
Recap on Tuesday’s lesson. Converting Temperatures Today you will be able to convert temperatures from degrees Celsius to degrees Fahrenheit and vise.
Thermodynamic Review Conversion Formula Example Celsius to Kelvin K = C o C = 294 K Kelvin to Celsius C = K – K = 40 o C Fahrenheit to.
Functions and Mathematical Models. Used to compute the values on a variable [Y] given values on other variables [X 1, X 2...]
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 1 Equations and Inequalities.
Heat The motion of the particles of matter. Heat Transfer Heat flows from an area of high heat to an area low in heat. Heat flows from an area of high.
Kelvin, Celsius, Fahrenheit. Fahrenheit In the 1700s, G. Daniel Fahrenheit developed a scale used by meteorologists for measuring surface temperature.
SI Base Units of Measurement in Chemistry. SI Units for Mass and Volume Mass: the amount of matter that an object contains –Base Unit: gram –Most Common.
Variables Damian Gordon. Variables We know what a variable is from maths. We’ve all seen this sort of thing in algebra: 2x – 10 = 0 2x = 10 X = 5.
11.1 Temperature. What is temperature? hotness or coldness of a material. where the heat should flow higher temperature to lower temperature Temperature.
REVIEW HOMEWORK ?? What is the formula for Avogadro’s Law? What happens to volume when the number of moles increases? Avogadro’s Law Questions 1-4.
Temperature SWBAT apply addition and subtraction of integers to Celsius and Fahrenheit temperature; use formulas to estimate temperatures in degrees Celsius.
Honors Chemistry Unit I - Power Point 6 Temperature Conversions Sections 1.7.
Bonifaci. Notes: (chapter 2.7) 3 different scales for temperature Celsius (metric system) Fahrenheit (used by US and GB, confusing) Kelvin (used by chemists.
T EMPERATURE What comes in your mind???. Temperature is measured using a thermometer. In Britain, we usually measure temperature in
Temperature and Slope in Excel NSF Summer Institute 2007 Jeff Rose.
Introduction to Video Game Programming (VGP) Mr. Shultz.
Interpreting Temperature Logger Data Changing Digitized Temperature Readings back into Temperatures.
Fahrenheit and Celsius Conversion Formulas Fahrenheit to Celsius: Celsius to Fahrenheit:
It is 2 o C The temperature drops by 3 degrees What temperature is it now? -1 o C.
Algebra II Honors—Day 7. Goals for Today Questions? Turn in Homework Stamp Sheet for a grade Test First Graded Homework Assignment (checked for accuracy)—due.
Temperature Measurement. As we have already seen there is more than one system of temperature measurement. There are occasions when we will need to convert.
1 Programming and Problem Solving — Software Engineering (Read Chap. 2)
Temperature Scales _________ scales are based on the boiling point which is ____ & freezing point of ___. Fahrenheit 212°32° __________________ scales.
Table of Contents Inverse Operations One Step Equations Two Step Equations Multi-Step Equations Variables on Both Sides More Equations Transforming Formulas.
Comparing Temperature Scales Units of Temperature Fahrenheit scale 0 F Celsius scale commonly used by scientists water boils at C 0 K coldest temperature.
© 2017 SlidePlayer.com Inc. All rights reserved.