Input and Output Output Prompt: –A message displayed to the user indicating what they are to enter. Should be clear and exact on what you want. write:

Slides:



Advertisements
Similar presentations
P1PMF Split1 QBASIC. P1PMF Split2QBasic Command Prompt Will launch the emulator DOS operating system? Press Alt + Enter to display the widescreen.
Advertisements

 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
1 ICS 101 – LAB 2 Arithmetic Operations I Putu Danu Raharja kfupm.edu.sa Information & Computer Science Department CCSE - King Fahd University.
True BASIC Ch. 6 Practice Questions. What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
James Tam Getting Started With Pascal Programming What is the basic structure of a Pascal Program Variables in Pascal Performing input and output with.
J. Michael Moore Input and Output (IO) CSCE 110 Drawn from James Tam's material.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 3 Control Statements.
Python November 14, Unit 7. Python Hello world, in class.
Chapter 2: Input, Processing, and Output
Introduction to Python
1 Arithmetic in C. 2 Type Casting: STOPPED You can change the data type of the variable in an expression by: (data_Type) Variable_Name Ex: int a = 15;
Input and Output (IO) CSCE 110 Drawn from James Tam's material.
1  Ex: Declare a variable to store user’s age: int age; Prompt the user to enter his/her age: printf (“ How old are you? “); Read / scan the entered value.
Basic Input/Output and Variables Ethan Cerami New York
Turning words into math. * u squared plus 3 * Identify the variable * Look at the words “squared” & “plus” * Think how can “squared” be notated * “plus”
 2004 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
1 The CONST definition CONST Pi = , City = ‘New York’; Constant identifiers are used when you do not want the value of an identifier to change why.
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
Pascal Programming Strings, Arithmetic operators and output formatting National Certificate – Unit 4 Carl Smith.
Input, Output, and Processing
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Lecture 2: Introduction to C Programming. OBJECTIVES In this lecture you will learn:  To use simple input and output statements.  The fundamental data.
Introduction to Pascal The Basics of Program writing.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 3 Selections.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X1 Chapter 3 Control Statements.
Pascal Programming Today Chapter 11 1 Chapter 11.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Assignment statement and Arithmetic operation 1 The major part of data processing.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
JavaScript 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
Using variable Variables are used to store values.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing a Line of Text in a Web Page 7.3 Another JavaScript.
Count Controlled Loops (Nested) Ain’t no sunshine when she’s gone …
1 More on Readln:numerical values Note: ENTER key counts sends a carriage return and a line feed to the computer definition: “white space”: space, tab,
Gator Engineering Copyright © 2008 W. W. Norton & Company. All rights reserved. 1 Chapter 3 Formatted Input/Output.
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.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 5, Lecture 2 (Tuesday)
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
Variables.. Part 2 Calculations. Review of yesterday Three types of variables var num:int var average:real var username:string No decimals Might have.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
Lecture 5: Layers of Control. Nested while Loops Problem Multiplying two numbers and outputting the result only if they are both less than 5. (i.e. Start.
Lesson 4: Introduction to Control Statements 4.1 Additional Operators Extended Assignment Operators –The assignment operator can be combined with the.
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.
ENGINEERING 1D04 Tutorial 1. WELCOME! What we’re doing today Who am I How to do well What are computer programs Software Development Cycle Pseudo Code.
Chapter 2 – part b Brent M. Dingle Texas A&M University
Chapter 6 JavaScript: Introduction to Scripting
Using the Console.
Chapter 2 More on Math More on Input
1-1 Logic and Syntax A computer program is a solution to a problem.
Data Types and Conversions, Input from the Keyboard
The CONST definition CONST Pi = , City = ‘New York’;
Programming Fundamental
Introduction to Scripting
CMP 131 Introduction to Computer Programming
INPUT & OUTPUT scanf & printf.
We are starting to program with JavaScript
Computer Science 1 Get out your notebook
Input, Variables, and Mathematical Expressions
Computer Science 1 Get out your notebook
Computer Science 1 Get out your notebook
Presentation transcript:

Input and Output

Output Prompt: –A message displayed to the user indicating what they are to enter. Should be clear and exact on what you want. write: –used for output, no return writeln: –has a return for next line to be printed on CRT.

Input readln –u–used to get the information from the user into a variable. –Y–YOU MUST PUT THE VARIABLE NAME!!! readln(name); –C–Can be used without a variable to hold the output on the screen. readln;

Formatting Output In a writeln you can combine literals and variables by seperating them by commas. –writeln(‘Hi ’, name, ’, it is nice to meet you!’);

More on Formatting You can increase the number of spaces that a variable uses. –writeln(‘Name’:10, ‘Date’:10); – Name Date For real numbers you can also state the number of places after the decimal. –writeln(‘Ave=‘, ave:5:1); –Ave= 95.6

Assignment Statement := is read “becomes equal to”. variable := expression. –ave := (num1+num2)/2; operators follow math order of operations –(+ = plus), (- = minus), (* = multiply), –(/= division), (div=quotient of integer division), –(mod=remainder of integer division)

Assignment Questions for chapter 4 are due Friday. Lab test on Friday 1/2 period #6 on page 110. Written Test on Friday ch 3 and 4 Program due next Friday –Do the 5 steps for the following assignment. –Number 4 on page 111. Be sure to be colorful and creative with your output. –Ask the user their name and include a title on the report. Like Luci’s Calorie Counter.