Test 2 Jason Jenkins Lauren Sears Aaron Stricklin Brandon Wolfe Julie Alexander.

Slides:



Advertisements
Similar presentations
User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Advertisements

Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
C++ Templates. What is a template? Templates are type-generic versions of functions and/or classes Template functions and template classes can be used.
Chapter 7: User-Defined Simple Data Types, Namespaces, and the string Type.
Objectives In this chapter, you will:
1 Week 1304/07/2005Course ISM3230Dr. Simon Qiu  Learn how to create and manipulate enumeration type  Become aware of the typedef statement  Learn about.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Chapter 11 Separate Compilation and Namespaces Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
1 Lecture-4 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems/Headington.
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process Dale/Weems/Headington.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 8: User-Defined Simple Data Types, Namespaces, and the string Type.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
Chapter 9: Arrays and Strings
C++ Programming: From Problem Analysis to Program Design, Second Edition Chapter 8: User-Defined Simple Data Types, Namespaces, and the string Type.
Chapter 9: Arrays and Strings
Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
Chapter 8 Arrays and Strings
Arrays. Objectives Learn about arrays Explore how to declare and manipulate data into arrays Learn about “array index out of bounds” Become familiar with.
Chapter 3 Data Structures and Abstract Data Type Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Arrays in C++ Numeric Character. Structured Data Type A structured data type is a type that stores a collection of individual components with one variable.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Chapter 8 Arrays and Strings
Object-Oriented Programming (OOP). Implementing an OOD in Java Each class is stored in a separate file. All files must be stored in the same package.
Introduction to Arrays in Java Corresponds with Chapter 6 of textbook.
EGR 2261 Unit 8 One-dimensional Arrays  Read Malik, pages in Chapter 8.  Homework #8 and Lab #8 due next week.  Quiz next week.
CHAPTER: 12. Array is a collection of variables of the same data type that are referenced by a common name. An Array of 10 Elements of type double.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Arrays.
DATA STRUCTURES LAB 1 TA: Nouf Al-harbi
Arrays  Array is a collection of same type elements under the same variable identifier referenced by index number.  Arrays are widely used within programming.
CHAPTER 7 arrays I NTRODUCTION T O C OMPUTER P ROGRAMMING (CSC425)
Chapter 8: Arrays and Functions Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
1 Topic: Array Topic: Array. 2 Arrays Arrays In this chapter, we will : Learn about arrays Learn about arrays Explore how to declare and manipulate data.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 8: User-Defined Simple Data Types, Namespaces, and the string Type.
1 One Dimensional Arrays Chapter 11 2 "All students to receive arrays!" reports Dr. Austin. Declaring arrays scores :
Review for Final Exam. Contents 5 questions (20 points each) + 1 bonus question (20 points) – Basic concepts in Chapters 1-4 – Chapters 5-9 – Bonus: Chapter.
Chapter 3 Functions. 2 Overview u 3.2 Using C++ functions  Passing arguments  Header files & libraries u Writing C++ functions  Prototype  Definition.
Operating System Using setw and setprecision functions Using setiosflags function Using cin function Programming 1 DCT
1 Chapter 12 Arrays. 2 C++ Data Types structured array struct union class address pointer reference simple integral enum char short int long bool floating.
UniMAP Sem2-10/11 DKT121: Fundamental of Computer Programming1 Arrays.
Chapter 8 Arrays. A First Book of ANSI C, Fourth Edition2 Introduction Atomic variable: variable whose value cannot be further subdivided into a built-in.
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.
Arrays.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 8: Simple Data Types, Namespaces, and the string Type.
1 Chapter 9 Arrays Java Programming from Thomson Course Tech, adopted by kcluk.
Opening Input/Output Files ifstream infile; ofstream outfile; char inFileName[40]; char outFileName[40]; coutinFileName;
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
1 Chapter 9 Arrays Java Programming from Thomson Course Tech, adopted by kcluk.
In C programming, one of the frequently arising problem is to handle similar types of data. For example: If the user want to store marks of 100 students.
Chapter 9 Arrays. Chapter Objectives Learn about arrays Explore how to declare and manipulate data into arrays Understand the meaning of “array index.
Chapter 9 Arrays. Chapter Objectives Learn about arrays Explore how to declare and manipulate data into arrays Understand the meaning of “array index.
Chapter 11 Structures, Unions and Typedef 11.1 Structures Structures allow us to group related data items of different types under a common name. The individual.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
KUKUM-06/07 EKT120: Computer Programming 1 Week 6 Arrays-Part 1.
Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
TK1924 Program Design & Problem Solving Session 2011/2012
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 8: Namespaces, the class string, and User-Defined Simple Data Types.
Objectives In this chapter, you will:
Objectives In this chapter, you will:
Enumeration Type Data type: a set of values with a set of operations on them Enumeration type: a simple data type created by the programmer To define an.
Computer Programming BCT 1113
CSC1201: Programming Language 2
Review for Final Exam.
MSIS 655 Advanced Business Applications Programming
EGR 2261 Unit 12 structs Read Malik, Chapter 9.
Chapter 6: User-Defined Functions I
Review for Final Exam.
CSC1201: Programming Language 2
Final Review Bina Ramamurthy 4/15/2019 BR.
Objectives In this chapter, you will:
Presentation transcript:

Test 2 Jason Jenkins Lauren Sears Aaron Stricklin Brandon Wolfe Julie Alexander

C++ Review (2) Chapter

Enumeration Type user defined simple data type Data type - a set of values together with a set of operations on those values To define a new simple data type, called enumeration type, we need three things: – A name for the data type – A set of values for the data type – A set of operations on the values

Enumeration Type syntax for enumeration type value1, value2, … are identifiers called enumerators value1 < value2 < value3 <...

typedef Statement typedef does not create any new data types typedef creates an alias to an existing data type Typedef int myInt;

Namespaces When a header file, such as iostream, is included in a program Global identifiers in the header file also become global identifiers in the program If a global identifier in a program has the same name as one of the global identifiers in the header file The compiler will generate a syntax error (such as identifier redefined) The same problem can occur if a program uses third party libraries

namespace where a member is usually – a variable declaration, – a named constant, – a function, or – another namespace

String

Structured Data Types -- Array A data type is called simple if variables of that type can store only one value at a time A structured data type is one in which each data item is a collection of other data items Array - a collection of a fixed number of components wherein all of the components have the same data type dataType arrayName[intExp]; dataType arrayName[intexp1][intexp2];

Array An array is a collection of a fixed number of components all of the same data type. Declaring: – dataType arrayName[intExp]; – int myArray[10] = {0}; – Int yourArray[] = {1,2,3}; Accessing: – arrayName[indexExp]; Write a function to find the max element in an array.

Multidimensional array dataType arrayName[][]…[]; Int matrix[NumOfRow][NumOfCol] Int matrix[NumOfRow][NumOfCol] = {0}; double matrix[2][2] = {{0.0,0.1}, {1.0,1.1}}; Accessing: – matrix[0][1]; Write a function to find the max element in each row of a matrix.

Array as parameters to Functions by reference only Functions can not return a value of the type array

Lab 1 Given a 10X5 matrix, transpose it to 5X10 matrix Input file: matrix.input Output file: matrix.output Write a function transposeMatrix to implement the transposition. Submit your code by 11:59pm Friday!

C++ reviews Chapter 11 – 12 Test 3: submit your test 3 in next class, only submit your answer sheet, please