is a specific set of data values along with a set of operations on those values. Review * Data type.

Slides:



Advertisements
Similar presentations
Chapter 9 Pointers and Dynamic Arrays. Overview 9.1 Pointers 9.2 Dynamic Arrays.
Advertisements

1 C++ Syntax and Semantics The Development Process.
Informática II Prof. Dr. Gustavo Patiño MJ
Dale/Weems/Headington
Javascript Essentials How do I write it??  Start Homesite  Between the start and end BODY tags type: 
1 Lecture-4 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems/Headington.
Chapter 2: Basic Elements of C++
1 CS150 Introduction to Computer Science 1 Arithmetic Operators.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems/Headington.
Data types and variables
Chapter 2: Basic Elements of C++
Chapter 2 Data Types, Declarations, and Displays
Chapter 2: Basic Elements of C++
Admin Office hours 2:45-3:15 today due to department meeting if you change addresses during the semester, please unsubscribe the old one from the.
CHAPTER 2 BASIC ELEMENTS OF C++. In this chapter, you will:  Become familiar with the basic components of a C++ program, including functions, special.
Lecture No: 16. The scanf() function In C programming language, the scanf() function is used to read information from standard input device (keyboard).
Chapter 2 Data Types, Declarations, and Displays.
Objectives You should be able to describe: Data Types
A First Book of ANSI C Fourth Edition
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Operaciones y Variables
Variables, Assignment & Math Storing and naming data.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
1 CSC103: Introduction to Computer and Programming Lecture No 6.
IXA 1234: C++ PROGRAMMING CHAPTER 2: PROGRAM STRUCTURE.
1 Chapter 3 Numeric Types, Expressions, and Output Dale/Weems/Headington.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
1 C++ Syntax and Semantics, and the Program Development Process.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems/Headington.
Arithmetic Operations. Review function statement input/output comment #include data type variable identifier constant declaration.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems.
C++ Programming: Basic Elements of C++.
Knowledge Base C++ #include using std namespace; int main(){} return 0 ; cout
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems.
CP104 Introduction to Programming Overview of C Lecture 4__ 1 Assignment Statements An assignment statement is to store a value in a variable variable.
C++ Data Types Structured array struct union class Address pointer reference Simple IntegralFloating char short int long enum float double long double.
THE BASICS OF A C++ PROGRAM EDP 4 / MATH 23 TTH 5:45 – 7:15.
Pointers: Basics. 2 What is a pointer? First of all, it is a variable, just like other variables you studied  So it has type, storage etc. Difference:
Syntax and Semantics, and the Program Development Process ROBERT REAVES.
1 C++ Data Types structured array struct union class address pointer reference simple integral enum char short int long bool floating float double long.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process.
Data Types Declarations Expressions Data storage C++ Basics.
CHAPTER 2 C++ SYNTAX & SEMANTICS #include using namespace std; int main() { cout
Formatting Output  Escape Sequences  iomanip.h Objects  setw()  setiosflags(…)  setprecision()
PROGRAM ESSENTIALS. TOKENS  SMALLEST UNITS OF A PROGRAM LANGUAGE  Special Symbols  Mathematical Operators  Punctuation  Word Symbols  Key Words.
Recap……Last Time [Variables, Data Types and Constants]
1 What is a Named Constant? A named constant is a location in memory that we can refer to by an identifier, and in which a data value that cannot be changed.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Programming in C++
2/4/2016Engineering Problem Solving with C++, Second Edition, J. Ingber 1 Engineering Problem Solving with C++, Etter/Ingber Chapter 2 Simple C++ Programs.
Chapter 2: Basic Elements of C++
Literals A literal (sometimes called a constant) is a symbol which evaluates to itself, i.e., it is what it appears to be. Examples: 5 int literal
Chapter 2: Basic Elements of C++. Introduction Computer program – Sequence of statements whose objective is to accomplish a task Programming – Process.
Dr. Sajib Datta Jan 21,  Declare a variable ◦ int height; [note that no value is still assigned]  Assign a variable a value ◦ height =
Chapter 2: Basic Elements of C++. Objectives In this chapter, you will: – Become familiar with the basic components of a C++ program, including functions,
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
1 A Simple “Hello World” Example #include // input-output library using namespace std; int main() // function main { cout
Formatting Output iomanip.h Objects Escape Sequences setw()
BASIC ELEMENTS OF A COMPUTER PROGRAM
Chapter 2 Topics Programs Composed of Several Functions
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
Introduction to C++ Programming
Variables Numbers can be stored and retrieved while a program is running if they are given a home. The way that integers and decimal numbers are stored.
CSE 100 Data Types Declarations Displays.
Review Data type is a specific set of data values along with a set of operations on those values. *
INC 161 , CPE 100 Computer Programming
Programming Fundamental-1
Presentation transcript:

is a specific set of data values along with a set of operations on those values. Review * Data type

Review name and define the data type that can be stored in each variable. Declaration statements

Integral char int enum Review * * * data types Name several data types: Floating point float double long Structured array struct union class Address pointer reference

is a location in RAM, referenced by an identifier. Where the program stores a value and from which the program can later retrieve that value. * Variable Review

is a value which doesn’t change. literal6.75 or “yes” or ‘Q’ symbolicPI = * Constant

simple: data-type variable name; compound: data-type var1, var2, var3; Review Syntax of a declaration: semicolon commas

Review An operator is a symbol that causes the compiler to take an action. * operator

Review The modulus operator yields the remainder of integer division. order of operations: * * * modulus operator order of operations: P E M D% A S from left to right

Review Operator overload means that the same operator will behave differently depending upon the operands. In mixed-mode, floating point takes precedence. * Operator overload

Review ( The assignment operator ( = )causes the operand on the left to take on the value to the right side of the statement. assignment operator What is the assignment operator and what does it do? This operator assigns from right to left.

Review What is the output? What is the output? 1. double pay_rate, inc; 2. cout << pay_rate << ‘\t’ << inc << ‘\n’; 3. pay_rate = 6.25; 4. inc = 0.1; 5. cout << pay_rate << ‘\t’ << inc << ‘\n’; 6. pay_rate = pay_rate*(1 + inc); 7. cout << pay_rate << ‘\t’ << inc << ‘\n’; * * *

Review cout What is cout? predefined stream object Where is is found? in iostream in standard C++ library What does it do? used with insertion operator (<<) to send data to the standard output device * * *

Review iomanip.h contains the objects which have special effects on the iostream. Give examples of these objects. setw(n) setprecision(n) setiosflags(ios::fixed) Found in standard C++ library * * * * iomanip

T h e E n d “So we went to Atari and said, ‘Hey, we’ve got this amazing thing, even built with some of your parts, and what do you think about funding us? Or we’ll give it to you. We just want to do it. Pay our salary, we’ll come work for you.’ And they said, ‘No.’ So then we went to Hewlett-Packard, and they said, ‘Hey, we don’t need you. You haven’t got through college yet.” “So we went to Atari and said, ‘Hey, we’ve got this amazing thing, even built with some of your parts, and what do you think about funding us? Or we’ll give it to you. We just want to do it. Pay our salary, we’ll come work for you.’ And they said, ‘No.’ So then we went to Hewlett-Packard, and they said, ‘Hey, we don’t need you. You haven’t got through college yet.” Apple’s founder Steve Jobs on attempts to get Atari and H-P interested in his and Steve Wozniak’s personal computer.