programming and problem solving with c++ 6th by dale ch07

58 165 0
 programming and problem solving with c++ 6th by dale ch07

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter Additional Control Structures Chapter Topics ● ● ● ● Switch Statement for Multi-Way Branching Do-While Statement for Looping For Statement for Looping Using break and continue Statements Chapter Topics ● ● ● Additional C++ Operators Operator Precedence Type Coercion in Arithmetic and Relational Precedence Switch Statement The Switch statement is a selection control structure for multi-way branching switch (IntegralExpression) { case case Constant1 : Statement(s); Constant2 : Statement(s); // optional // optional default : Statement(s); } // optional // optional Example of Switch Statement float weightInPounds = 165.8; char weightUnit; // User enters letter for desired weightUnit switch (weightUnit) { case ‘P’ : case ‘p’ : cout

Ngày đăng: 06/02/2018, 10:07

Từ khóa liên quan

Mục lục

  • Chapter 7 Additional Control Structures

  • Chapter 7 Topics

  • Slide 3

  • Switch Statement

  • Example of Switch Statement

  • Example of Switch Statement, continued

  • Slide 7

  • Control in Switch Statement

  • Slide 9

  • Do-While Statement

  • PowerPoint Presentation

  • Do-While Loop vs. While Loop

  • Do-While Loop

  • For Loop

  • Slide 15

  • Example of For Loop

  • Example of Repetition

  • Slide 18

  • Slide 19

  • Example of Repetition

Tài liệu cùng người dùng

Tài liệu liên quan