Week_8_CSCI_524_1901_Arpankumar_assignment_109_00_4193

Week_8_CSCI_524_1901_Arpankumar_assignment_109_00_4193 -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI524-1901-Programming Languages Principles-FA10-CHEN Name: Arpankumar Patel                                                                                                                 ID : 109-00-4193 Assignment(week 8 )chap. No. 7 Question 1) Please list all possible Multiple Selection Constructs and describe the difference between them. Answer Multiple Selection Constructs - I: Pascal’s case statement has the form as follows, case expression of constant_list_1 : statement_1 ; …. constant_list_n : statement_n ; end ; The C multiple selector construct, switch, which also appears in C++ and Java, is a relatively primitive design. Its general form is as follows. switch ( expression) { case constant_expression_1 : statement_1 ; …. case constant_expression_n : statement_n ; [ default : statement_n + 1 ] }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CSCI524-1901-Programming Languages Principles-FA10-CHEN Name: Arpankumar Patel                                                                                                                 ID : 109-00-4193 Multiple Selection Constructs - II: C includes a break statement for existing both switch and the bodies of C’s loop structures. In many situations, a case construct is inadequate for multiple selections. For example, when selections must be made on the basis of a Boolean expression rather than some ordinal type, nested two-way selectors can be used to simulate a multiple selector. if
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Week_8_CSCI_524_1901_Arpankumar_assignment_109_00_4193 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online