Select Case intLevel Case 1, 2 strStatus = "Bronze" Case 3 To 5 strStatus = "silver" Case 6, 7 strStatus = "Gold" Case Else strStatus "Platinum" End Select

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

What will the code in Figure 4-55 assign to the strStatus variable when the intLevel
variable contains the number 7?
a. Bronze
b. Gold
c. Platinum
d. Silver 

Select Case intLevel
Case 1, 2
strStatus = "Bronze"
Case 3 To 5
strStatus = "silver"
Case 6, 7
strStatus =
"Gold"
Case Else
strStatus
"Platinum"
End Select
Transcribed Image Text:Select Case intLevel Case 1, 2 strStatus = "Bronze" Case 3 To 5 strStatus = "silver" Case 6, 7 strStatus = "Gold" Case Else strStatus "Platinum" End Select
Expert Solution
Step 1

To know the assigned value to the variable named strStatus when the variable named intLevel is initialized with the number 7.

 

The given code is:

 

Select Case intLevel

       Case 1, 2

              strStatus = "Bronze"

       Case 3 To 5

              strStatus = "Silver"

       Case 6, 7

              strStatus = "Gold"

       Case Else

              strStatus = "Platinum"

End Select

Step 2

In the above code,

 

The Select Case statement contains a variable named intLevel.

 

The first Case is executed for the value 1 and 2 of the variable named intLevel.

This Case assigns the code "Bronze" to the variable named strStatus.

 

The second Case is executed for the value 3 to 5 of the variable named intLevel.

This Case assigns the code "Silver" to the variable named strStatus.

 

The third Case is executed for the value 6 and 7 of the variable named intLevel.

This Case assigns the code "Gold" to the variable named strStatus.

 

The fourth Case is executed for the other values of the variable named intLevel.

This Case assigns the code "Platinum" to the variable named strStatus.

 

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
ListBox
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education