Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "is a specific set of data values along with a set of operations on those values. Review * Data type."— Presentation transcript:

1

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

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

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

5 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

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

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

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

9 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

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

11 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.

12 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’; * * * 2. !@#$%&^$ 5. 6.250.1 7. 6.8750.1

13 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 * * *

14 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

15 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.


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

Similar presentations


Ads by Google