# 9 case

50 %
50 %
Education

Published on March 9, 2014

Author: fyjordan9

Source: slideshare.net

Basic Scientific Programming Case Statement

The Case Construct  Used in cases where exactly one of several alternative actions is selected and performed. form Select Case(Selector) case(label-list1) statement sequence1 case(label-list2) statement sequence2 “ case(label-list n) statement sequence n End select

  Selector is an integer, character, or logical expression. The values in the list may have any of the forms: (value) single value (value1: value2) range of values from value1 through value2. (value1:) range of values greater than or equal to value1 (: value2) range of values less than or equal to value2

Example  Select Case(Class_Code) Case(1) print*,’Freshman’ Case(2) print*,’Sophomore’ Case(3) print*,’Junior’ Case(4) print*,’Senior’ Case Default print*, ‚error,Illegal code‛ End Select

Example: Pollution Index   A case statement can be used to carry out the classification given (good, fair, or poor). A case statement can be used to replace an IF / ELSE IF structure.

Range Selectors “Integers”  Select Case(Int(average)) case(90:) grade = ‚A‛ case(80:89) grade = ‚B‛ case(70:79) grade = ‚C‛ case(60:69) grade = ‚D‛ case(:59) grade = ‚F‛ End Select

Range Selectors “Characters”  Select Case(char) case(‘A’: ‘Z’) Print*, ‘uppercase’ case(‘a’: ’z’) Print*, ‘lowercase’ case(‘0’:’9’) Print*, ‘numbers’ case default Print*, ‘Not a letter or number’ End Select

What about real valued selectors??   A selector can’t be of type real. To make a selection, convert the real number to an integer and then use it for the selection.

example Suppose a motors’ RPM is determined by an indicator x.  high speed x>= 5.5  normal speed 2.5<= x < 5.5  Low speed x < 2.5 Select Case(int(10*x)) case(55:) print*, ‚HIGH SPEED‛ case(25:54) print*, ‚NORMAL SPEED‛ case(:24) print*, ‚LOW SPEED‛ End Select

 User name: Comment:

## Related presentations

#### How to Write an A+ Research Paper – Guide for St...

September 21, 2017

#### 5 Simple Mistakes That Can Kill Your Essay

September 21, 2017

#### Anatomy of the Mind Exploring Psychological Mechan...

September 21, 2017

#### Applied Big Data Analytics in Operations Managemen...

September 21, 2017

#### Screening of Mungbean Genotypes against Mungbean ...

September 21, 2017

#### Status of the Mung Bean Yellow Mosaic Virus (MYMV)...

September 21, 2017

## Related pages

### Cool cases for phones, tablets and laptops - 9cases.com

This site is where you can find the best cases for your phone, tablet and laptop. Don't miss the best and cool cases for your beloved devices

### eSeries™ 9 case - Waterproof Case for Galaxy™ S® III ...

Designed for larger smartphones, such as Motorola® Moto X™ and Galaxy™ S® III, the eSeries™ 9 case delivers submersible ...

### Lowepro Lens Case 9 x 13cm Objektivköcher ...

Objektivköcher Lowepro Lens Case 9 x 13cm: Preis ab 19,90 € (30.10.2015). 34 Preise für Lowepro Lens Case 9 x 13cm Objektivzubehör - Preisvergleich ...

### 9 11 iPhone Cases - 9 11 iPhone 6, 6 Plus, 5S, and 5C Case ...

446 customizable 9 11 iPhone cases & covers from Zazzle - Choose your favorite 9 11 design from a variety of cases for the iPhone 6, 6 Plus, 5S, and 5C.

### Nexus 9 case roundup | Android Central

Keep that Nexus 9 covered When a new Android tablet like the Nexus 9 arrives, third-party cases soon follow. The folks at our store are working out exactly ...

### Case 39 (2009) - IMDb

created 9 months ago Taibas Playlist. a list ... Title: Case 39 (2009) 6.2 /10. Want to share IMDb's rating on your own site? Use the HTML below. ...

### Supremery Ultra Slim HTC Nexus 9 Schutzhülle: Amazon.de ...

Supremery Ultra Slim HTC Nexus 9 Schutzhülle Flipcover Tasche Book Case mit Auto Sleep und Wake-funktion schwarz

### Amazon.com: E-Case e-Series Case, Blue, 9: Sports & Outdoors

My son sealed his cell phone in the e-series 9 case to go kayaking. The kayak tipped and the phone went into 4 feet of water near our sea wall.